Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (12.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.2k 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

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

+2 votes
3 answers
0 votes
1 answer

Browse Categories

...