问题
I'm having some difficulties importing the module dht11 from the Adafruit library(https://github.com/adafruit/Adafruit_Python_DHT). I'm using a raspberry pi3 model b, and have installed python 3.5. I downloaded the Adafruit and installed using
sudo python3 setup.py install
and I'm fairly certain that the installation went well since I connected my temp and humidity sensor and using
sudo python3 examples/AdafruitDHT.py 11 2
I get correct reading about temp and humidity, yet when I try to import the dht11 module (I'm using spyder as ide) I get the 'no module named dht11'. I tried appending the directory in the sys.path but still get the same error.
Edit: I tried both python 2 and 3, get the same error
Edit2: I tried other IDE as well, but no one is working. I opted to launch the script.py directly from terminal since this way it's working. If anyone has a solution, it would be greatly appreciated.
来源:https://stackoverflow.com/questions/46630060/importing-dht11-adafruit-python