python中pip下载错误的问题

参考文章:https://blog.csdn.net/cn_1937/article/details/81449484

文章中的解决方案:就两种下载方式

  • 第一种常规但是最慢
pip install pymysql
  • 第二种就是用镜像:不过又分两种写法
  • pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn pymysql
    
  • pip install https://pypi.tuna.tsinghua.edu.cn/simple pymysql

一般国内就是三个镜像:

清华:https://pypi.tuna.tsinghua.edu.cn/simple

阿里云:http://mirrors.aliyun.com/pypi/simple/

豆瓣:http://pypi.douban.com/simple/

note:新版ubuntu要求使用https源,要注意。

例如:pip3 install -i https://pypi.douban.com/simple/ 包名

两种镜像可能会有以下两种报错方式:

第一种带--trusted-host 的报错:
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
ERROR: Could not find a version that satisfies the requirement movie
ERROR: No matching distribution found for movie
第二种(不带trust host的):
  ERROR: Cannot unpack file C:\Users\HP\AppData\Local\Temp\pip-unpack-lmqnkf6f\simple.html (downloaded from C:\Users\HP\AppData\Local\Temp\pip-req-build-0ls22eva, co
ntent-type: text/html); cannot detect archive format
ERROR: Cannot determine archive format of C:\Users\HP\AppData\Local\Temp\pip-req-build-0ls22eva

一般来说第二种的报错都可以用加上--trust-host的方式来解决,如果加上了还不行,建议参考https://blog.csdn.net/Dashi_Lu/article/details/87798473

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值