I get:
pi@raspberrypi:~/grove.py $ pip3 install seeed_dht
Collecting seeed_dht
Could not find a version that satisfies the requirement seeed_dht (from versions: )
No matching distribution found for seeed_dht
if I try and re-install dht
This is my original problem:
pi@raspberrypi:~/grove.py $ sudo ./lesson_7.py
Traceback (most recent call last):
File “./lesson_7.py”, line 5, in
from seeed_dht import DHT
ImportError: No module named ‘seeed_dht’
The source code from seeed:
| #!/usr/bin/env python3 | |
|---|---|
| import time | |
| from seeed_dht import DHT | |
| from grove.display.jhd1802 import JHD1802 | |
| def main(): | |
| # Grove - 16x2 LCD(White on Blue) connected to I2C port | |
| lcd = JHD1802() | |
| # Grove - Temperature&Humidity Sensor connected to port D5 | |
| sensor = DHT(‘11’, 5) | |
| while True: | |
| humi, temp = sensor.read() | |
| print(‘temperature {}C, humidity {}%’.format(temp, humi)) | |
| lcd.setCursor(0, 0) | |
| lcd.write(‘temperature: {0:2}C’.format(temp)) | |
| lcd.setCursor(1, 0) | |
| lcd.write(‘humidity: {0:5}%’.format(humi)) | |
| time.sleep(1) | |
| if name == ‘main’: | |
| main() |