0

I'm working with reading sensor values through a Raspberry Pi 3 using Python, and I'm currently using this library: https://github.com/szazo/DHT11_Python. I am fairly new to the language and since there are no instructions in the README on how to install this library, I was wondering if anyone knows how to do it manually? I would just like to get rid of this error:

Traceback (most recent call last): 
   File "sensorRead.py", line 4, in <module>
     import dht11
ImportError: No module name 'dht11'

So far, I ran these commands:

sudo git clone https://github.com/szazo/DHT11_Python.git
cd DHT11_Python
sudo apt-get update
sudo apt-get install build-essential python-dev python-openssl

Then, I moved the library from /home/pi to /usr/lib but I'm still getting the same error. I must be missing something.

If anyone knows how to properly install this library, then please help! Thank you!

1
  • please mark the answer below as accepted Commented Jun 13, 2018 at 23:18

1 Answer 1

2

You just need to have your sensorRead.py file in the same folder as dht11.py

Sign up to request clarification or add additional context in comments.

3 Comments

additionally you can get that file with git clone ... command
@user9849588 Hm, then should I just copy the dht11.py file to the same place where sensorRead.py is?
@Melissa yes, that's the easiest way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.