When upgrading pip (to v10) on at least Ubuntu 16.04, the pip3 command stops working ("cannot import main", see below). This is on a fresh install.
What I've run:
(Note that I've stripped out all the apt output etc., since I think it's not needed here. Let me know if you still want it!)
me@host$ sudo docker run -it ubuntu:xenial
root@container# apt update && apt install python3-pip
root@container# pip3 --version
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)
root@container# pip3 install --upgrade pip
Collecting pip
Downloading pip-10.0.0-py2.py3-none-any.whl (1.3MB)
100% |################################| 1.3MB 1.4MB/s
Installing collected packages: pip
Found existing installation: pip 8.1.1
Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr
Successfully installed pip-10.0.0
root@container# pip --version
pip 10.0.0 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)
root@container# pip3 --version
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
ImportError: cannot import name 'main'
root@container# cat /usr/bin/pip3
#!/usr/bin/python3
# GENERATED BY DEBIAN
import sys
# Run the main entry point, similarly to how setuptools does it, but because
# we didn't install the actual entry point from setup.py, don't use the
# pkg_resources API.
from pip import main
if __name__ == '__main__':
sys.exit(main())
This is a known issue with pip on Ubuntu systems that have a "system-installable" pip (though an Ubuntu package). See this thread for far more information than I could ever begin to reproduce.
I've found this bug when trying to upgrade pip to 10. Without it I am unable to install Django 2.x.x with python 3.x.x.
I couldnt find a fix for it so I'll copy this over here and see if you guys have any solutions.
Description:
When upgrading pip (to v10) on at least Ubuntu 16.04, the pip3 command stops working ("cannot import main", see below). This is on a fresh install. What I've run:
(Note that I've stripped out all the apt output etc., since I think it's not needed here. Let me know if you still want it!)