• 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
  • 相关阅读:
    STM32之HAL开发——CubeMX配置串行Flash文件系统
    ASP.NET Core - 配置系统之配置提供程序
    SPI机制是什么?
    可逆矩阵的性质
    【面试必刷TOP101】 删除有序链表中重复的元素-I & 删除有序链表中重复的元素-II
    开源实时数仓 Apache Doris 毕业了,未来如何走得更远?
    【转信创】银河麒麟:系统安全机制
    构建RAG应用-Datawhale笔记
    SSH 多密钥配置
    代码随想录二刷 | 数组 | 总结篇
  • 原文地址:https://blog.csdn.net/weixin_43509127/article/details/132975096