by XDK
9. August 2019 14:46
Exception:
File "/usr/bin/pip", line 9, in <module> from pip import main ImportError: cannot import name main
Explanation:
The exception appears after installing python-pip in the environment. looks like, the get-pip.py script from github is outdated which may be the reason for the exception.
Quick Fix:
Reinstalling python-pip from https://bootstrap.pypa.io website fixed the exception.
sudo apt-get purge python-pip
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py