Reputation: 379
I have installed pip according to instructions on pip website. Downloaded get-pip.py and insatlled it with python get-pip.py
. Got a confirmation saying installation is successful. Apparently the moment i type pip i get following error:
[fh-mi-sdb99-ma:~/Downloads] sdb99% pip
/Library/Python/2.5/site-packages/pip-6.1.1-py2.5.egg/pip/__init__.py:211: Warning: 'as' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "/usr/local/bin/pip", line 8, in <module>
load_entry_point('pip==6.1.1', 'console_scripts', 'pip')()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/pkg_resources.py", line 271, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/pkg_resources.py", line 2174, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/pkg_resources.py", line 1907, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/Library/Python/2.5/site-packages/pip-6.1.1-py2.5.egg/pip/__init__.py", line 211
except PipError as exc:
^
SyntaxError: invalid syntax
i am not sure why is this happening.. Any suggestion that would help me to get pip installed correctly on my mac?
Thanks!
EDIT:
[fh-mi-sdb99-ma:~/Downloads] sdb99% python --version
Python 2.7.9
[fh-mi-sdb99-ma:~/Downloads] sdb99% pip --version
/Library/Python/2.5/site-packages/pip-6.1.1-py2.5.egg/pip/__init__.py:211: Warning: 'as' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "/usr/local/bin/pip", line 8, in <module>
load_entry_point('pip==6.1.1', 'console_scripts', 'pip')()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/pkg_resources.py", line 271, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/pkg_resources.py", line 2174, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/pkg_resources.py", line 1907, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/Library/Python/2.5/site-packages/pip-6.1.1-py2.5.egg/pip/__init__.py", line 211
except PipError as exc:
^
SyntaxError: invalid syntax
Second EDIT:
I have installed python 3.5 pkg but still when i type python on terminal, python 2.7 is initiated..
Upvotes: 4
Views: 16273
Reputation: 83458
Python 2 is end-of-life. Python 3.4+ comes with pip
You are using Python 2.5, outdated version:
/Library/Python/2.5/
Please install at least Python 2.7 first:
https://www.python.org/downloads/
Upvotes: 2
Reputation: 13927
Your stack trace indicates that you are actually running python2.5
To verify your python version run python --version
.
I would also verify your pip version by running pip --version
.
If you already installed python2.7, you can often specify it specifically, for example: python2.7 my_module.py
. Try typing python
in your terminal and tap TAB twice. This will list all the python* programs you have in your path. If python2.7 is not listed, you will need to install it.
Similar to the above about using the correct python, you should ensure you are using the correct pip.
Try typing pip
into your terminal and tap TAB twice. This will list any extra pip versions you have. It is often easier to specify pip2.7
.
If you haven't made a firm decision between python2 and python3, a nice feature of python3 is that python3.4 is bundled with pip, so you don't have to do anything to use it.
Upvotes: 5