0

I've installed pip using sudo easy_install pip command. I've also checked that it was installed using which pip command.

However, I'm not able to uninstall it now as it was advised here using sudo pip uninstall pip command

I'm getting the following error:

File "/usr/local/bin/pip", line 11, in <module>
    load_entry_point('pip==21.1.3', 'console_scripts', 'pip')()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2843, in load_entry_point
    return ep.load()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2434, in load
    return self.resolve()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2440, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Library/Python/2.7/site-packages/pip-21.1.3-py2.7.egg/pip/__init__.py", line 1, in <module>
    from typing import List, Optional
ImportError: No module named typing

So, I've tried to solve this problem using a solution proposed here, however I'm still getting this error.

Can someone help me to remove it, please?

  • Does `python3 -m pip uninstall pip` result in the same error? If so can you try the solution here https://stackoverflow.com/a/22053391/12128336. –  Jul 11 '21 at 18:29

1 Answers1

1

Go to the location /usr/local/bin and delete following files:

  • pip
  • pip2
  • pip2.7
  • Any other file with a prefix pip.

If you get permission error for any file e.g. pip2, change the permission using root user as chmod +x pip2.

Now, go to /Library/Python/2.7/site-packages/ and delete all packages with prefix pip. Also delete from Library/Python/3/, if you've installed in python3 too.

Jishan Shaikh
  • 1,572
  • 2
  • 13
  • 31