Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. Documents say paho will work for python 3.x equally but cannot get it to install. It only installs to 2.7 using pip. 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. Did dist-upgrade before trying.

like image 337
djcmalvern Avatar asked Jan 20 '26 18:01

djcmalvern


1 Answers

On Ubuntu as a Linux based system the following worked for installing Paho with Python3

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. Above was the sequence of installs which succeeded after the standard pip3 install paho-mqtt failed to install the library correctly. Best of luck!

like image 162
Julian Wise Avatar answered Jan 22 '26 12:01

Julian Wise