Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 树莓pi与ds18b20的接口_Python_Raspberry Pi3 - Fatal编程技术网

Python 树莓pi与ds18b20的接口

Python 树莓pi与ds18b20的接口,python,raspberry-pi3,Python,Raspberry Pi3,我一直在使用raspberry pi进行一个家庭自动化项目。我需要导入模块 用于与ds18b20通信的传感器。我们的模块目前是用python 2.7编写的,ds18b20是用python 3.3编写的 python 2.7中是否有ds18b20的替代方案 由于截止日期的原因,将代码从Python2.7移植到3.3不是一个选项 来自官方: 对于Python3:sudo apt get安装Python3-w1传感器 对于Python2:sudo apt get install python-w1th

我一直在使用raspberry pi进行一个家庭自动化项目。我需要导入模块 用于与ds18b20通信的传感器。我们的模块目前是用python 2.7编写的,ds18b20是用python 3.3编写的

python 2.7中是否有ds18b20的替代方案

由于截止日期的原因,将代码从Python2.7移植到3.3不是一个选项

来自官方:

对于Python3:sudo apt get安装Python3-w1传感器


对于Python2:sudo apt get install python-w1thermsensor

当您安装w1thermsensor时,您使用的是pip3吗?如果是,您可以尝试使用Python2.7 pip pip install传感器安装模块