Whenever I am trying to install any package using pip, I am getting this import error:
guru@guru-notebook:~$ pip3 install numpy
Traceback (most recent call l
I met the same problem on my Ubuntu 16.04 system. I managed to fix it by re-installing pip with the following command:
curl https://bootstrap.pypa.io/get-pip.py | sudo python3
Trick and works too
sudo -H pip install lxml
You can try this:
sudo ln -sf $( type -P pip ) /usr/bin/pip
This Worked for me !
hash -r pip # or hash -d pip
Now, uninstall the pip installed version and reinstall it using the following commands.
python -m pip uninstall pip # sudo
sudo apt install --reinstall python-pip
If pip is broken, use:
python -m pip install --force-reinstall pip
Hope it helps!
resolved in one step only.
I too faced this issue, But this can be resolved simply by 1 command without bothering around and wasting time and i have tried it on multiple systems it's the cleanest solution for this issue. And that's:
For python3:- sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall
.
By this , you can simply install packages using pip3
. to check use pip3 --version
.
For older versions, use : sudo python -m pip uninstall pip && sudo apt install python-pip --reinstall
.
By this, now you can simply install packages using pip
. to check use pip --version
.
The commands above didn't work for me but those were very helpful:
sudo apt purge python3-pip
sudo rm -rf '/usr/lib/python3/dist-packages/pip'
sudo apt install python3-pip
cd
cd .local/lib/python3/site-packages
sudo rm -rf pip*
cd
cd .local/lib/python3.5/site-packages
sudo rm -rf pip*
sudo pip3 install jupyter