Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/usr/local/bin/python: No module named pip

Tags:

python

linux

pip

I installed pip, but if I try to install a package with

python -m pip install requests

it says

/usr/local/bin/python: No module named pip

How can I figure out where the problem is?

The problem is not with pip, but that the modules are not installed in the right way, so I can’t use them in Python. I am using Ubuntu 15.04 (Vivid Vervet).

like image 856
cbl Avatar asked Oct 08 '15 18:10

cbl


1 Answers

My situation is that the Python 3 works fine, but pip 3 does not work (the default Python version is Python 2.7, but it doesn't matter).

I solve this problem by the following command:

apt-get purge python3-pip
apt-get install -y python3-pip

And if you are not the root user, you may need to add sudo in the beginning of the command.

like image 170
liushan CHEN Avatar answered Sep 18 '22 07:09

liushan CHEN