简体   繁体   English

pip install selenium语法错误

[英]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? 我想从网站上抓取内容,但是尝试安装Selenium时已经出现以下错误,想法?

/Library/Python/2.5/site-packages/pip-9.0.1-py2.5.egg/pip/__init__.py:220: 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/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-9.0.1-py2.5.egg/pip/__init__.py", line 220
    except PipError as exc:
                     ^
SyntaxError: invalid syntax

According to the documentation currently Selenium is supported by Python 2.7, 3.5 versions and above. 根据目前的文档 ,Python 2.7、3.5和更高版本支持Selenium。 If you use Python 2.5 you won't be able to use Selenium. 如果您使用Python 2.5,则将无法使用Selenium。

You can download latest Python version from here and re-try installation 您可以从此处下载最新的Python版本,然后重试安装

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM