Really new to raspi, i followed all of the install of software the hello world works and button test but nothing else just installed the os today and updated and this is what i get
Traceback (most recent call last):
File “/home/duh/weatherhat-python/examples/weather.py”, line 13, in
import weatherhat
File “/home/duh/.local/lib/python3.9/site-packages/weatherhat/init.py”, line 6, in
import ioexpander as io
File “/home/duh/.local/lib/python3.9/site-packages/ioexpander/init.py”, line 3, in
from smbus2 import SMBus, i2c_msg
can anybody help me
Unfortunately, you’ve clipped off the first line of that error message that would have told us what the problem actually is, but at a guess… have you enabled i2c on your Pi?
There should have been an actual error message after the traceback block you posted - something along the lines of OSError: or RuntimeError:.
The traceback is great for telling us where the problem happened, but it makes diagnosis a lot easier when we know what happened too :-)
Given you have things like Hello World working, the most likely remains a failure to enable i2c - the installer usually does it for you, but double check in raspi-config, under Interfacing Options
Traceback (most recent call last):
File “/home/duh/weatherhat-python/examples/weather.py”, line 740, in
main()
File “/home/duh/weatherhat-python/examples/weather.py”, line 709, in main
sensordata = SensorData()
File “/home/duh/weatherhat-python/examples/weather.py”, line 649, in init
self.sensor = weatherhat.WeatherHAT()
File “/usr/local/lib/python3.9/dist-packages/weatherhat/init.py”, line 81, in init
self._ioe.on_interrupt(self.handle_ioe_interrupt)
File “/usr/local/lib/python3.9/dist-packages/ioexpander/init.py”, line 410, in on_interrupt
self._gpio.add_event_detect(self._interrupt_pin, self._gpio.FALLING, callback=callback, bouncetime=1)
RuntimeError: Failed to add edge detection