简体   繁体   English

无法在Python 3.x中安装paho-mqtt

[英]Cannot install paho-mqtt in Python 3.x

I have installed paho-mqtt on raspberry pi running wheezy with both python 2.7 and 3.5 on board. 我已经安装了paho-mqtt on raspberry pi运行wheezy与python 2.7和3.5 on board。 Documents say paho will work for python 3.x equally but cannot get it to install. 文件说paho将同样适用于python 3.x但无法安装它。 It only installs to 2.7 using pip. 它只使用pip安装到2.7。 Any clues how to get it to work on 3.1 I installed it fine on Windows version of python 3.5.2 but not via raspberry. 任何线索如何让它在3.1上工作我在Windows版本的python 3.5.2上安装得很好但不是通过覆盆子。 Did dist-upgrade before trying. 在尝试之前是否进行了升级。

On Ubuntu as a Linux based system the following worked for installing Paho with Python3 在Ubuntu作为基于Linux的系统上,以下工作用于使用Python3安装Paho

sudo apt-get install mosquitto
sudo apt-get install mosquitto-clients
sudo python3 -m pip install paho-mqtt

It may be that the final python3 install succeeds without the proceeding steps. 可能是最终的python3安装成功而没有前面的步骤。 Above was the sequence of installs which succeeded after the standard pip3 install paho-mqtt failed to install the library correctly. 以上是在标准pip3 install paho-mqtt无法正确安装库之后成功安装的顺序。 Best of luck! 祝你好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM