问题描述
因此,我已将DHT22湿度传感器正确连接到我的BeagleBone Black RevC.我在MacBook Pro上运行OS Mavericks,并且按照Adafruit提供的说明使用DHT22
So I've properly attached DHT22 Humidity Sensor to my BeagleBone Black Rev C.I'm running OS Mavericks on my MacBook Pro and I followed the directions provided by Adafruit on how to use my DHT22
我使用的网站非常清楚: https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/software-install-updated
The website I used was pretty clear: https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/software-install-updated
这也是我克隆的github文件: https://github.com/adafruit/Adafruit_Python_DHT
Also here is the github files I cloned: https://github.com/adafruit/Adafruit_Python_DHT
我输入了以下几行:
git clone https://github.com/adafruit/Adafruit_Python_DHT.git
cd Adafruit_Python_DHT
sudo apt-get upgrade
sudo apt-get install build-essential python-dev
sudo python setup.py install
cd examples
sudo ./AdafruitDHT.py 22 P8_11
我成功到最后一行.输入最后一行(sudo ./AdafruitDHT.py 22 P8_11)后,我收到以下错误消息:
I am successful until that last line. Once I enter that last line (sudo ./AdafruitDHT.py 22 P8_11), I get the following error message:
Traceback (most recent call last):
File "./AdafruitDHT.py", line 23, in <module>
import Adafruit_DHT
ImportError: No module named Adafruit_DHT
我知道某个地方有一个Adafruit_DHT文件,因为当我进入Adafruit_Python_DHT目录时,我得到了:
I know there is an Adafruit_DHT file somewhere because when I ls in the Adafruit_Python_DHT directory, I get this:
root@beaglebone:~/Adafruit_Python_DHT# ls
Adafruit_DHT examples ez_setup.py ez_setup.pyc LICENSE README.md setup.py source
我尝试重新安装setup.py,但结果仍然相同.
I've tried reinstalling the setup.py, but the outcome is still the same.
我遵循了Adafruit提供的所有指示,但是我似乎无法超越.有什么想法吗?这似乎是一个简单的问题,但事实证明,这是从DHT22中获取读数的主要障碍.如果需要更多信息来帮助解决此问题,请告诉我.
I've followed all the directions Adafruit provided, but I just can't seem to get past this. Any idea on what is going on? It seems like a simple problem, but it's proving to be one major obstacle in getting readings from my DHT22. If there is more information needed to help answer this problem please let me know.
推荐答案
简单的解决方法:
cd Adafruit_Python_DHT
sudo apt-get update
sudo apt-get install build-essential python-dev python-openssl
sudo python setup.py install
尝试再次运行sudo ./AdafruitDHT.py ## ## ...
文件
您可能忘记了正确运行安装程序.
You may have forgot to run the setup properly.
这篇关于DHT22传感器导入Adafruit_DHT错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!