0

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.

Giacomo Giovannini
  • 177
  • 2
  • 2
  • 14
  • Have you tried import Adafruit_DHT on Python3 console? – Hendri Tobing Oct 08 '17 at 11:58
  • Yes, I tried that too. I don't understand why it's not working. – Giacomo Giovannini Oct 08 '17 at 12:38
  • You should check you can actually find the library in a physical directory included in the file system, also it might sound really niche but different versions of python 2 or 3 have modules split by directory on /usr/local so it might be that it's a different version of 3 or 2 – Scott Anderson Feb 05 '19 at 19:13

0 Answers0