Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't install pip on mac.
#1
I have tried most of the commands that you can use on mac to install pip through terminal, and for some reason it always got to syntax error and it couldn't download anything. My mac is a late 2013 macbook air running on mac os bug sur with intel i5. Here is what terminal tells me when i try to install pip:Last login: Tue Oct 26 15:42:26 on ttys002
daniilkirillov@Daniils-MacBook-Air ~ % sudo easy_install pip
Password:
Searching for pip
Reading https://pypi.org/simple/pip/
Downloading https://files.pythonhosted.org/packages/...d3faa3033a
Best match: pip 21.3.1
Processing pip-21.3.1.tar.gz
Writing /tmp/easy_install-NGF_St/pip-21.3.1/setup.cfg
Running pip-21.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-NGF_St/pip-21.3.1/egg-dist-tmp-oulcZU
Traceback (most recent call last):
File "/usr/bin/easy_install", line 13, in <module>
load_entry_point('setuptools==41.0.1', 'console_scripts', 'easy_install')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 2316, in main
**kw
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 418, in run
self.easy_install(spec, not self.no_deps)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 679, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 705, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 890, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 1158, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 1144, in run_setup
run_setup(setup_script, args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 253, in run_setup
raise
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 195, in setup_context
yield
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 195, in setup_context
yield
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 44, in _execfile
code = compile(script, filename, 'exec')
File "/tmp/easy_install-NGF_St/pip-21.3.1/setup.py", line 7
def read(rel_path: str) -> str:
^
SyntaxError: invalid syntax
daniilkirillov@Daniils-MacBook-Air ~ %
Reply
#2
Looks like that's using Python 2. Just install Python 3, which is the currently supported version and cones with pip.
Reply
#3
Look at The right and wrong way to set Python 3 as default on a Mac
Reply
#4
(Oct-26-2021, 01:47 PM)ndc85430 Wrote: Looks like that's using Python 2. Just install Python 3, which is the currently supported version and cones with pip.
Thanks! Could u tell me how can i update python through terminal?
Reply
#5
(Oct-26-2021, 02:20 PM)snippsat Wrote: Look at The right and wrong way to set Python 3 as default on a Mac
Hey! So i installed python 3.10 on my mac, the only thing i don't quite get is how to make it my interpreter in vscode
Reply
#6
(Oct-26-2021, 03:09 PM)Tsushida Wrote: Hey! So i installed python 3.10 on my mac, the only thing i don't quite get is how to make it my interpreter in vscode
Click down in left corner you get up Python: Select Interpreter or as link Ctrl+Shift+P start typing.
Look at VS Code from start for tips.
One Extension that make running code easier is Code Runner get a button up in right corner and other shortcuts.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020