How to find my pip?
When you install pip
with python getpip.py
, the pip
command gets installed next to the python binary. In your case that is /usr/local/2.7.11/bin
. As your python executable is found through its link, that directory is not used for any other commands.
Your PATH should have paths, i.e. directories, not full file names.
The directory to include in your PATH is /usr/local/python-2.7.11/bin
.
If you do that you can get rid of the link.
You can also setup a link:
ln -s /usr/local/python-2.7.11/bin/pip /usr/bin/pip
As python is found because of the link, and pip installed (but not found), you can also invoke pip by doing:
python -m pip
and you can make that into an alias if you don't want to add an extra link:
alias pip='/usr/local/python-2.7.11/bin/python -m pip'
Related videos on Youtube
theivanxu
Updated on September 18, 2022Comments
-
theivanxu over 1 year
Yesterday I installed the pip with
python get-pip.py
and it can be regular used. Now it shows this.
-bash: pip: command not found
so I try to use python get-pip.py to install it again.
Requirement already up-to-date: pip in /usr/local/python-2.7.11/lib/python2.7/site-packages
But what about the PATH?
Then I try to add all of involved path into PATH.
/usr/local/python-2.7.11/bin/pip:/usr/local/python-2.7.11/bin/python2.7:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/python-2.7.11/bin/python
None of those work.
I saw some similar questions which told me to find the correct path.
# which python # /usr/bin/python which pip ...(nothing)
The python's installed path is /usr/local/python-2.7.11. I used
ln -s /usr/local/python-2.7.11/bin/python /usr/bin/python
before install pip.My system is Debian7.
-
Prometheus over 4 yearsNo module named pip error
-
Anthon over 4 yearsyes that is what you get before you install pip with
python getpip.py
, thanks for sharing. -
Jake about 4 yearsthis worked for me alias pip='/usr/local/python-2.7.11/bin/python -m pip'