• 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
  • 相关阅读:
    计算机专业毕业论文安卓毕业设计源码基于Uniapp+Springboot实现的患者服药提醒APP[包运行成功]
    NarrowBERT: Accelerating Masked Language Model Pretraining and Inference
    redis HyperLogLog数据类型——亿级用户访问量统计解决方案
    springboot 拦截器 导致fastjson 大小写失效
    std::atomic<>
    yolov5调用zed相机实现三维社交距离检测(单类别)
    面试必问之JVM常用参数
    Node.js之async 和 await 关键字及微任务和宏任务
    AppleWatch是真的能够减少我iPhone的使用时长
    多御安全浏览器使用技巧,剖析7大优点特性
  • 原文地址:https://blog.csdn.net/weixin_43509127/article/details/132975096