Additional information may help solve your problem. I have the same sensor as you.
I followed this guide: https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/software-install-updated
git clone https://github.com/adafruit/Adafruit_Python_DHT.git cd Adafruit_Python_DHT sudo apt-get update sudo apt-get install build-essential python-dev sudo python setup.py install
And this is my test python script:
#!/usr/bin/python import sys import Adafruit_DHT humidity, temperature = Adafruit_DHT.read_retry(11, 4) if humidity is not None and temperature is not None: print 'Temp={0:0.1f}*C Humidity={1:0.1f}%'.format(temperature, humidity) else: print 'Failed to get reading. Try again!'
Save it, for example, dht_test.py, Chmod: sudo chmod a + x dht_test.py and run it as sudo: sudo./dht_test.py Perhaps this will help you.
source share