0

I am having trouble with installing pip on my Mac which is running Big Sur. I was running Python 3.9, but down graded to 3.8.2. This has broken pip. Initially I was getting an interpreter error (I have lost the message). I have since run some commands (easy_install related) which have made it worse and now when I type pip into my terminal I get the following:

Gaurangs-New-MacBook-Pro:~ gaurangxxxxxxx$ pip
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 11, in <module>
    load_entry_point('pip==21.0', '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.0-py2.7.egg/pip/_internal/cli/main.py", line 60
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax

Can someone please help me clean this up and trouble shoot/fix the problem. What do I need to do? Please help!

TheAnalyst
  • 21
  • 1
  • 5
  • Seems that your `pip` runs for Python 2.7. Try `pip3` – costaparas Jan 30 '21 at 07:18
  • Ran pip3 and this is the output: Gaurangs-New-MacBook-Pro:~ gaurangxxxxxxxx$ pip3 -bash: /usr/local/bin/pip3: /usr/local/opt/python@3.9/bin/python3.9: bad interpreter: No such file or directory – TheAnalyst Jan 30 '21 at 07:19
  • Try `python3.8 -m pip` to run under the right version, or uninstall `pip` and reinstall it again. – costaparas Jan 30 '21 at 07:23
  • python3 -m pip install responds but errors out in the following way: Gaurangs-New-MacBook-Pro:~ gaurangxxxxxxxxxx$ python3 -m pip install numpy ERROR: ERROR: Command errored out with exit status 1: command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/10/lrbc2zks4x78d1rfzh5g5fs00000gn/T/tmppbiagv1n cwd: /private/var/folders/10/lrbc2zks4x78d1rfzh5g5fs00000gn/T/pip-install-6j34ri9b/num – TheAnalyst Jan 30 '21 at 07:31
  • How do you uninstall it safely? – TheAnalyst Jan 30 '21 at 07:32
  • From control panel – Ibrahim Jan 30 '21 at 07:41

0 Answers0