Christiaan G Christiaan G - 3 years ago 243
Python Question

pip install selenium syntax error

I want to scrape content from a website, but I get the following error already when trying to install selenium, thoughts?

/Library/Python/2.5/site-packages/pip-9.0.1-py2.5.egg/pip/ 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==9.0.1', 'console_scripts', 'pip')()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/", 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/", line 2174, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/", line 1907, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/Library/Python/2.5/site-packages/pip-9.0.1-py2.5.egg/pip/", line 220
except PipError as exc:
SyntaxError: invalid syntax

Answer Source

According to the documentation currently Selenium is supported by Python 2.7, 3.5 versions and above. If you use Python 2.5 you won't be able to use Selenium.

You can download latest Python version from here and re-try installation

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download