0 votes
1 view
in AWS by (8.9k points)

I wanted to deploy my Python app on Amazon Linux AMI 2015.09.1, which has Python2.7 (default) and pip (6.1.1). Then, I upgraded the pip using the command:

sudo pip install -U pip

However, it seemed broken, and showed the message when I tried to install packages:

pkg_resources.DistributionNotFound: pip==6.1.1

I found out that pip remove the previous files located in /usr/bin/, and installed the new one in /usr/local/bin. Thus, I tried to specify the location by using the command:

sudo pip install -U --install-option="--prefix='/usr/bin'" pip

Nevertheless, it still installed the new one in /usr/local/bin. In addition to that, pip could not work well with sudo although it successfully installed. The error message :

sudo: pip2.7: command not found

Is there a way to properly manage pip?

1 Answer

0 votes
by (18.5k points)

if you run the following command, it should give something like "no pip in ($PATH)" as the output.

sudo which pip

If this is the case then run the following command:

which pip

This command will give the path of pip that should look something like: /usr/local/bin/pip

Copy and paste this path to pip to sbin directory using the following command:

 cp /usr/local/bin/pip /usr/sbin/

Now you should be able to run sudo pip without any errors.

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !