Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't remove python pip

i've installed both python3 and python it used to work everything perfect but today i encountered several issues with pip

then i tried to uninstall it and install it again i've made

sudo apt-get remove pip
sudo apt-get remove pip3
sudo apt-get purge pip
sudo apt-get purge pip3
sudo apt-get remove python-setuptools
sudo apt-get remove python3-setuptools

and when i write down "pip" at the prompt i still have this error:

    Traceback (most recent call last):
  File "/usr/local/bin/pip", line 9, in <module>
    load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 356, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2476, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2190, in load
    ['__name__'])
  File "/usr/local/lib/python3.4/dist-packages/pip-9.0.1-py3.4.egg/pip/__init__.py", line 21, in <module>
    from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
  File "/usr/local/lib/python3.4/dist-packages/pip-9.0.1-py3.4.egg/pip/_vendor/requests/__init__.py", line 65, in <module>
    from . import utils
  File "/usr/local/lib/python3.4/dist-packages/pip-9.0.1-py3.4.egg/pip/_vendor/requests/utils.py", line 22, in <module>
    from . import certs
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1467, in exec_module
  File "<frozen importlib._bootstrap>", line 1570, in get_code
  File "<frozen importlib._bootstrap>", line 656, in _compile_bytecode
ValueError: bad marshal data (unknown type code)

what do you suggest? thanks

like image 535
komarek Avatar asked May 08 '17 12:05

komarek


People also ask

How do I clear my pip cache?

If you want to force pip to clear out its download cache and use the specific version you can do by using --no-cache-dir command. If you are using an older version of pip than upgrade it with pip install -U pip. This will help you clear pip cache.

How do I remove old versions of pip?

What you need to do to solve this issue is navigate to the Pip from the version that you have installed the package, in this case, 3.7, uninstall or update the package using this pip. Save this answer.


2 Answers

you need to execute the following command to install pip sudo apt-get install python3-pip

and to remove you need to use sudo apt-get --purge autoremove python3-pip

like image 64
Bidyut Avatar answered Oct 14 '22 10:10

Bidyut


I had the same problem, but I solved using the command below:

sudo python -m pip uninstall pip
like image 12
riquellopes Avatar answered Oct 14 '22 12:10

riquellopes