Skip to content

module busio has no attribute 'OneWire' #11

Closed
@PabloAndo

Description

@PabloAndo

Recently I'm working with some DS18B20 sensors and a raspberry pi zero and I'm getting AttributeError executing the following code:

`import time
import board
from adafruit_onewire.bus import OneWireBus
from adafruit_ds18x20 import DS18X20

ow_bus = OneWireBus(board.D4)
ds18 = DS18X20(ow_bus, ow_bus.scan()[0])

while True:
print('Temperature: {0:0.3f}C'.format(ds18.temperature))
time.sleep(1.0)`

The error I get:
File "test_circuitpython_1.py", line 12, in <module> ow_bus = OneWireBus(board.D4) File "/usr/local/lib/python3.5/dist-packages/adafruit_onewire/bus.py", line 77, in __init__ self._ow = busio.OneWire(pin) AttributeError: module 'busio' has no attribute 'OneWire'

A these are the packages installed on the raspberry pi:

Adafruit-Blinka (1.2.8)
adafruit-circuitpython-ads1x15 (1.0.2)
adafruit-circuitpython-busdevice (2.2.9)
adafruit-circuitpython-ds18x20 (1.1.3)
adafruit-circuitpython-onewire (1.1.2)
adafruit-circuitpython-register (1.7.0)
Adafruit-PlatformDetect (1.0.0)
Adafruit-PureIO (0.2.3)
chardet (2.3.0)
circuitpython-build-tools (1.1.9)
Click (7.0)
cryptography (1.7.1)
idna (2.2)
keyring (10.1)
keyrings.alt (1.3)
pip (9.0.1)
pyasn1 (0.1.9)
pycrypto (2.6.1)
pygobject (3.22.0)
pyserial (3.2.1)
python-apt (1.1.0b5)
pyxdg (0.25)
requests (2.12.4)
rpi-ws281x (4.1.0)
RPi.GPIO (0.6.5)
schedule (0.6.0)
SecretStorage (2.3.1)
semver (2.8.1)
setuptools (40.8.0)
six (1.12.0)
spidev (3.4)
ssh-import-id (5.6)
sysv-ipc (1.0.0)
urllib3 (1.19.1)
wheel (0.29.0)

Any idea why? Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions