Reputation: 176
I am trying to install paho-mqtt package for my python project. But it gives the error
Error: Python packaging tool 'pip' not found.
I am using ubuntu 16.04 and I am running this command
pip install paho-mqtt
Can anyone tell me is there another way to install this?
Upvotes: 0
Views: 16896
Reputation: 2770
There is another relevant answer to the OP's question "is there another way to install this", which is that python packages such as paho.mqtt can be installed with the OS package manager, such as apt
Background
In 2024, attempting to run sudo apt install paho-mqtt
will give the message:
error: externally-managed-environment
This post: How do I solve "error: externally-managed-environment" every time I use pip 3? explains that it is python feature designed to promote the use of virtual environments.
However, in some cases, such as running python in a docker container, it is a nuisance.
Solutions are
pipx
can help with this--break-system-packages
sudo apt install python-paho-mqtt
Bear in mind though that the system package manager may not have access to the same version which you need. In my case apt
installed 1.6.1-1, and I needed 2.0.0.
Upvotes: -1
Reputation: 535
Python uses pip to install various Python modules like request, jsonpickel etc.
So you need to install pip first as said by @Asoul
Upvotes: 0
Reputation: 1016
Install pip first, if using python2
sudo apt-get install python-pip
or for python3
sudo apt-get install python3-pip
Upvotes: 1