You can use pip
the command to install the Python module of Paho-MQTT, the specific steps are as follows:
-
Make sure your system has installed Python and pip, if not, please install it first.
-
Open a terminal or command line tool and enter the virtual environment where you want to install Paho-MQTT.
-
Execute the following command to install Paho-MQTT:
pip install paho-mqtt
-
Wait for the installation process to complete, and execute the following command to verify:
python -c "import paho.mqtt.client as mqtt; print(mqtt.__version__)"
If the version number of Paho-MQTT is output, it means the installation is successful.
Note: If you need to install other versions of Paho-MQTT, you can use the following command to install:
pip install paho-mqtt==X.Y.Z
Where XYZ is the version number of Paho-MQTT to be installed.