You can Install the MQTT client using PIP with the command:
It usually isn’t as straightforward as using the command
pip install paho-mqtt
as most machines have multiple versions of python installed and there are several versions of pip and the actual command depends on whether you are on Windows or Linux.
Therefore use the command:
pip --version
before installing to find out where pip will install the files.
The screen shot below is taken from my Windows 10 machine where I have two versions of Python installed (3.4 and 3.6)
If I ran
pip install paho-mqtt
It would install the client in the 3.6 site packages. To install it for the 3.4 version I would need to run.
pip3.4 install paho-mqtt
On my Raspberry pi (linux) using the command
pip install paho-mqtt
would install the client for use my python version 2.7
linux-pip
To install for version 3.5 I would need to run:
pip3 install paho-mqtt
Note: if you have multiple versions of python on your machine then take a look at my Python Notes.
Note: On the PI and maybe other linux versions if you get an error on install then use sudo pip install paho-mqtt.
Description
Tutorial Outline
Installing The Client
If I ran