python安装库时报错 Could not fetch URL https://pypi.org/simple/selenium/:

8.11更新:之前用的python是3.7版本,反正在pycharm里面直接下第三方库就一直出问题,而且下下来之后运行也是报错

ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。

今天心灰意冷之下用了3.9版本的 python,结果不仅可以直接在pycharm里面下库不用去cmd pipinstall那么烦,而且运行也成功了

总而言之,总算可以开始学习了。

另外如果有朋友知道其中原因的话希望能够解答一下~

8.10

本来第三方库我一直是通过pycharm下的,很久没用python了今天要用一个新的库结果一直报错:

Could not fetch URL https://pypi.org/simple/mayavi/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/mayavi/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/mayavi/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/mayavi/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/mayavi/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/mayavi/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/mayavi/
ERROR: Could not find a version that satisfies the requirement mayavi (from versions: none)
ERROR: No matching distribution found for mayavi


翻阅了一些解决方案后通过cmd指令解决了,需要从镜像下载

注:最后的mayavi是我要下载的库,根据需要自行更改库名

pip install -t D:\anaconda\envs\python37\Lib\site-packages -i https://pypi.douban.com/simple mayavi

还有一点要注意的就是如果直接pip install的话,会下载到默认python版本,我的默认python版本是2.7。如果电脑里有多个python版本就要像我这样通过

-t D:\anaconda\envs\python37\Lib\site-packages

来指定python版本

但是这个库下载成功之后,我以同样的指令下另外一个库又报错如下:

C:\Users\admin>pip install -t D:\anaconda\envs\python37\Lib\site-packages -i https://pypi.douban.com/simple seaborn
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Looking in indexes: https://pypi.douban.com/simple
Collecting seaborn
  Downloading https://pypi.doubanio.com/packages/b2/86/43b8c9138ef4c2a1c492fee92792c83c13799d0e2061ff810d3826d06cd1/seaborn-0.9.1-py2.py3-none-any.whl (216 kB)
     |████████████████████████████████| 216 kB 113 kB/s
ERROR: Could not find a version that satisfies the requirement scipy>=0.17.1 (from seaborn) (from versions: none)
ERROR: No matching distribution found for scipy>=0.17.1 (from seaborn)

我换了个cmd指令之后就成功了:

注:seaborn是我要下载的库,自行更改库名

pip install seaborn -t D:\anaconda\envs\python37\Lib\site-packages -i https://pypi.douban.com/simple 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

唐唐唐吖

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值