I have been trying to install pip for python 2.7, but I am unable to. I want pip to work for both python 2.7 and python 3. Here is a summary of what I have done so far:
python -V
Python 2.7.15
echo $PATH
... /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin ...
I've also done a few checks to know where everything is (I have two '/usr/local/bin/python'). I believe there should only be one?
which -a python
/usr/local/bin/python
/usr/local/bin/python
/usr/bin/python
which python
/usr/local/bin/python
ls -l $(which python)
lrwxr-xr-x 1 XXXXX admin 36 May 24 14:28 /usr/local/bin/python -> ../Cellar/python@2/2.7.15/bin/python
When I do:
brew list python | grep pip
I only get results for python3, nothing at all for python2
/usr/local/Cellar/python/3.6.5/bin/pip3
Things I have tried that do not work, include:
python get-pip.py
"can't open file 'get-pip.py': [Errno 2] No such file or directory"
brew install pip
"Error: No available formula with the name "pip" "
I appreciate your help!
It seems you are on a Mac. Since you have Python installed, that means you have
easy_install
as well.I'm using linux Ubuntu and could solve my Pip/Python environment following this steps:
Restore PYTHON 3:
if necessary...
Restore PYTHON 2:
if necessary...
In my case the last command was the one that make the big trick I was missing. Moreover the version 9.0.3 is the last version works for me.
To download get_pip.py file run
Then try
Docs here: https://pip.pypa.io/en/stable/installing/