0

Import Error: No module named Adafruit_DHT
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Import Error: No module named Adafruit_DHT

by Ratzo on Fri Jul 07, 2017 7:34 am

Hi,
I'm pretty new to this Raspberry Pi/Python stuff so that may be part of the issue.

Anyway, I am trying to use the DHT22 on my Raspberry Pi (Version 1), I have installed the Adafruit_DHT library, and it works when testing with
Code: Select all | TOGGLE FULL SIZE
sudo ./AdafruitDHT.py 22 4


But, when trying to incorporate it into my own module with
Code: Select all | TOGGLE FULL SIZE
import AdafruitDHT
I get the ImportError:
ImportError: No module named Adafruit_DHT

Thanks in advance

Ratzo
 
Posts: 2
Joined: Fri Jul 07, 2017 6:45 am

Re: Import Error: No module named Adafruit_DHT

by Ratzo on Fri Jul 07, 2017 12:55 pm

SOLVED:

It was me being dumb: I checked my version of python (2.7) for which the Adafruit_DHT was installed; but Thonny on the Pi was running for Python 3.4.
Now using Idle, all is good

Ratzo
 
Posts: 2
Joined: Fri Jul 07, 2017 6:45 am

Please be positive and constructive with your questions and comments.