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

报错如下:

pip install -i https://pypi.douban.com/simple selenium
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

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

pip install --index-url http://mirrors.aliyun.com/pypi/simple/ selenium --trusted-host mirrors.aliyun.com
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
  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
本执行程序exe是工程《Python爬虫【零】问题介绍 -- 对“微博辟谣”账号的历史微博进行数据采集》https://blog.csdn.net/u010086122/article/details/114957255 为Windows编译的可执行程序,基于Python3.7+selenium制作,工程源代码: https://download.csdn.net/download/u010086122/16086467 ----------------------------------------------------------------------------------------- 1. 执行项目前,需要下载selenium对应的浏览器驱动程序(driver.exe),并放在本机环境变量路径中,否则会报错安装操作具体可见博客专题中的指导【二】 2. 执行程序,会在系统用户默认路径下,创建一个虚拟的python环境(我的路径是C:\Users\Albert\AppData\Local\Temp\_MEI124882\),因此启动项目所需间较长(约30秒后屏幕才有反应,打出提示),请耐心等待;也正因如此,执行电脑本身环境是可以无需安装pythonselenium依赖包的 3. 本项目采用cmd交互方式执行,因此等到屏幕显示: 选择爬取方式: 1. 移动版微博爬取 2. PC网页版微博爬取(单线程) 3. PC网页版微博爬取(页面内多线程) 4. PC网页版微博爬取(多线程异步处理多页面) 后,用键盘输入1~4,敲回车执行 4. 此exe编译,工程代码内编写的最终excel记录保存地址为:相对工程根路径下的excel文件夹;因此当本exe执行到最后保存数据,会因为此excel文件夹路径不存在而报错。若在工程中将保存地址改为绝对路径(例如D:\excel\),再编译生成exe执行,则最终爬取数据可以正确保存
安装selenium,出现了错误信息"Could not find a version that satisfies the requirement selenium (from versions: ) No matching distribution found for selenium"。这个错误通常是由于没有找到与所需版本相匹配的分发版本导致的。 解决这个问题的一种方法是检查你安装Python版本和系统的位数是否与所需的selenium版本相匹配。例如,如果你的Python版本是3.5,并且是64位的系统,你需要找到对应的selenium版本。 另一种解决方法是尝试使用其他安装方法,比如使用包管理工具pip来安装selenium。你可以使用命令"pip install selenium"来安装最新版本的selenium。如果这个方法也不起作用,你可以尝试前往selenium的官方网站查找其他可用的安装方式。 总结起来,解决"Could not find a version that satisfies the requirement selenium (from versions: ) No matching distribution found for selenium"错误的方法有两种:确保你的Python版本和系统位数与所需的selenium版本相匹配,或者尝试使用其他安装方法,比如使用pip或前往官方网站查找其他可用的安装方式。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [python pip 安装工具包报错:Could not find a version that satisfies the requirement torch==1.3.0](https://blog.csdn.net/night098/article/details/104324810)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [Could not find a version that satisfies the requirement PIL (from versions: ) No matching distribu](https://download.csdn.net/download/weixin_38722721/13750519)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值