首页 文章

找不到满足要求selenium的版本;在Python3.6.5上安装Selenium时,没有找到匹配的selenium分布

提问于
浏览
0
pip install selenium

抛出错误:

Could not find a version that satisfies the requirement selenium;
No matching distribution found for selenium

请指导如何继续

1 回答

  • 0

    此错误消息...

    Could not find a version that satisfies the requirement selenium;
    No matching distribution found for selenium
    

    ...暗示Python客户端无法安装 Selenium 相关模块 .

    您的主要问题可能与 pip 版本或Python安装有关 .

    解决方案

    • 卸载当前的Python安装 .

    • 在Windows 7专业操作系统上使用CCleaner工具在新安装Python客户端之前擦除所有操作系统 .

    • 下载并安装兼容的Python 3.6.5二进制/可执行文件的新版本 .

    • 确保您使用的是最新版本 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
    
    • 安装 Selenium 的最新版本:
    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
    

相关问题