• Python安装selenium时报错:ERROR: No matching distribution found for selenium 附解决方法


    报错如下:

    pip install -i https://pypi.douban.com/simple selenium
    
    • 1
    Looking in indexes: https://pypi.douban.com/simple
    Could not fetch URL https://pypi.douban.com/simple/selenium/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.douban.com', port=443): Max retries exceeded with url: /simple/selenium/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:777)'),)) - skipping
    Could not fetch URL https://pypi.douban.com/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.douban.com', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:777)'),)) - skipping
    
    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:777)'),)': /simple/selenium/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:777)'),)': /simple/selenium/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:777)'),)': /simple/selenium/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:777)'),)': /simple/selenium/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:777)'),)': /simple/selenium/
    ERROR: Could not find a version that satisfies the requirement selenium (from versions: none)
    ERROR: No matching distribution found for selenium
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12

    通过该方法可以成功解决报错:

    pip install --index-url http://mirrors.aliyun.com/pypi/simple/ selenium --trusted-host mirrors.aliyun.com
    
    • 1
    Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
    Collecting selenium
      Downloading http://mirrors.aliyun.com/pypi/packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl (904 kB)
    Requirement already satisfied: urllib3 in c:\programdata\anaconda3\lib\site-packages (from selenium) (1.22)
    Installing collected packages: selenium
    Successfully installed selenium-3.141.0
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
  • 相关阅读:
    zabbix agent 6.0安装脚本
    深入理解Linux网络笔记(一):内核是如何接收网络包的
    【数学建模】基于SIR模型实现新冠病毒COVID-19估计附matlab代码
    01 HTTP协议相关
    【性能测试】初识 Jmeter 中的 BeanShell
    【JavaScript高级】01-this的指向
    计数的窗口函数应用(2)
    python随手小练5
    黑马点评-02使用Redis代替session,Redis + token机制实现
    含氟废水处理工艺案例
  • 原文地址:https://blog.csdn.net/weixin_43509127/article/details/132975096