I installed both python and python2 packages (as well as their "-dev" and a myriad of other packages, almost everything in termux.com's repository) and noticed that initially pip and pip2 point to 3.5 and 2.7 respectively. This is good. But then if I try to upgrade pip2 (by pip2 install --upgrade pip) then pip no longer points to 3.5 --- both pip and pip2 now point to 2.7, look:
$ pip -V
pip 8.1.2 from /data/data/com.termux/files/usr/lib/python2.7/site-packages (python 2.7)
$ pip2 -V
pip 8.1.2 from /data/data/com.termux/files/usr/lib/python2.7/site-packages (python 2.7)
I am using Termux v0.40 and everything is freshly installed today (on the Genymotion emulator)
I've had that. It's because you updated pip2. If you update pip2 it will overwrite pip, breaking everything.
Hm, I guess that --no-default-pip should be given to pip2 when updating to avoid it overwriting pip.
It would be nice if one could configure pip2 to remember that configuration.
@fornwall Attempting to pass --no-default-pip option results in no such option: --no-default-pip error.
Aha, I was using python2 -m ensurepip --upgrade --no-default-pip, but perhaps the pip2 tool doesn't support something similar?
A current workaround is to skip pip/pip3/pip2 and run python -m pip, like in:
python -m pip install httpie
python2 -m pip install httpie
Related discussion: https://github.com/pypa/pip/issues/3164
@fornwall Thank you, I've learned something new :)
Hi all,
I just ask a question at https://github.com/pypa/pip/issues/4276 (By default, which version of python should pip point to? python 2.7, python 3.5 pip 9.0.1)
Maybe you can chime in as it relates to this topic of discussion.
On any computer you can discover what pip is like this:
$ type pip
pip is /usr/local/bin/pip
$ cat /usr/local/bin/pip
#!/usr/local/bin/python3.6
# -*- coding: utf-8 -*-
import re
import sys
from pip import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
As you see, pip is just a python script and the version of python which it corresponds to is entirely determined by the interpreter which is listed on the first line.
We need to stick with pip 10.0 . Upgrading pip to 18.0 causes this bug.
By default package python2 provides pip2 and pip2.7.
Package python (v3.7) provides pip, pip3 and pip3.7.
So problem perhaps fixed.
Upgrading pip to 18.0 causes this bug.
Pip is installed via python -m ensurepip --upgrade --default-pip, so default pip version is reasonable and shouldn't be upgraded to avoid potential problems.
Most helpful comment
We need to stick with pip 10.0 . Upgrading pip to 18.0 causes this bug.