I tried to install a package through pip3, and I got this error. Every pip/pip3 command that I run gives me this error-
alexg@hitbox:~$ pip3 -V
Traceback (m
I'm using virtualenv and upgrading setuptools didn't work for me. What did work was this workaround:
pip uninstall setuptools -y && pip install setuptools
After trying all kinds of methods, such as reinstall pip, setuptools, and still can't fix the problem. I follow the instruction of https://github.com/pypa/pip/issues/4216#issuecomment-286348680 and only with an external warning. After that, I use pip to uninstall matplotlib. Finally, all things seem okay.
I fixed this with follows:
$curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
For python2:
$python get-pip.py
For python3:
$python3 get-pip.py
Now it works for me.
This probably means that your dependencies got messed up.
Try to uninstall pip3 from scratch and it should work.
In case it doesn't work, delete your pip installation. In your case:
rm -r /home/alexg/.local/lib/python3.5/site-packages/pip/
And to be sure next time, best to work with virtual environments :)
None of the other posted answered worked for me, but running the follow command solved t:
sudo apt-get purge --auto-remove python3-pkg-resources python3-setuptools
Yet another answer, but following is the one which eventually fixed the issue for me. Since pip was compromised I was unable to use it for upgrading itself or setuptools and also using easy_install was bringing up the same issue. So I tried to install pip using Python.
The answer:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
pip install --upgrade setuptools