The bug is found in pip 10.0.0.
In linux you need to modify file: /usr/bin/pip from:
from pip import main
if __name__ == '__main__':
sys.exit(main())
to this:
from pip import __main__
if __name__ == '__main__':
sys.exit(__main__._main())
Even though the original question seems to be from 2015, this 'bug' seems to affect users installing pip-10.0.0
as well.
The workaround is not to modify pip
, however to change the way pip is called. Instead of calling /usr/bin/pip
call pip
via Python itself. For example, instead of the below:
pip install <package>
If from Python version 2 (or default Python binary is called python
) do :
python -m pip install <package>
or if from Python version 3:
python3 -m pip install <package>
On Ubuntu Server 16, I have the same problem with python27. Try this:
Change
from pip import main
if __name__ == '__main__':
sys.exit(main())
To
from pip._internal import main
if __name__ == '__main__':
sys.exit(main())
On Windows 10, I used the following commands to downgrade pip:
python -m pip uninstall pip
python -m pip install pip==9.0.3
This should also work on Linux and Mac too.
I had the same problem, but uninstall and reinstall with apt and pip didn't work for me.
I saw another solution that presents a easy way to recover pip3 path:
sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall
i fixed the problem by reinstalling pip using get-pip.py
.
python get-pip.py
.And pip is fixed and work perfectly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With