pip install selenium
将错误抛出为:
Could not find a version that satisfies the requirement selenium;
No matching distribution found for selenium
请指导如何进行
答案 0 :(得分:1)
我有同样的问题。我有conda,所以我用了它,它就像一个魅力!
$conda install selenium
答案 1 :(得分:0)
此错误消息...
Could not find a version that satisfies the requirement selenium;
No matching distribution found for selenium
...表示 Python客户端无法安装与 Selenium 相关的模块。
主要问题可能与 pip 版本或 Python 安装有关。
确保您使用的是最新版本的 pip (现在提供最新版本18.0):
C:\Users\username>python -m pip install --upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 1.3MB 544kB/s
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Successfully installed pip-18.0
安装最新版本的硒:
C:\Users\username>pip install selenium
Collecting selenium
Downloading https://files.pythonhosted.org/packages/b8/53/9cafbb616d20c7624ff31bcabd82e5cc9823206267664e68aa8acdde4629/selenium-3.14.0-py2.py3-none-any.whl (898kB)
100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 901kB 380kB/s
Requirement not upgraded as not directly required: urllib3 in c:\python\lib\site-packages (from selenium) (1.22)
Installing collected packages: selenium
Found existing installation: selenium 3.12.0
Uninstalling selenium-3.12.0:
Successfully uninstalled selenium-3.12.0
Successfully installed selenium-3.14.0
或:
C:\Python35\Scripts\pip.exe install selenium
答案 2 :(得分:0)
我没有输入pip install silenium,而是输入:“ pip.exe install selenium”,这对我有用