I have pip 8.1 installed and I wanted to upgrade to > 9.0.1 (to install matplotlib for python 2.7). I saw How to upgrade pip to latest? and did
sudo -H pip3 install --upgrade pip
sudo -H pip2 install --upgrade pip
but after than, if I type pip --version
, I get
ckim@chan-ubuntu:~$ pip --version
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main
This had I experienced before and I knew the solution(Hmm. sounds like German word order..:)) , so I did
sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall
sudo python -m pip uninstall pip && sudo apt install python-pip --reinstall
and then I type pip --version
and get
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
This is back to 8.1.1. How can I upgrade to newest version?
ADD : I'm using 16.04.5 LTS. This in system environment.(ok in python 2.7 virtual environment)
pip --version
shows 18.1 from my Ubuntu release, so older? My guess is 16.04 LTS (https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=python-pip) but we shouldn't be guessing.... – guiverc Feb 28 '19 at 09:23