指定国内镜像源来安装某个库(使用pip安装 )

例子:清华大学镜像安装ctrl-benchmark库出现问题

ERROR: HTTP error 404 while getting https://pypi.tuna.tsinghua.edu.cn/packages/b9/87/877a378eedf805e43f1b32cbb683fb2273838f95b5f49720e3651b9b3477/ctrl-benchmark-4.9.0.tar.gz
#sha256=d21ad91f885b3d0a02a32c428627f778a6b826e0dbcb678f81252123de87cfc0 (from https://pypi.tuna.tsinghua.edu.cn/simple/ctrl-benchmark/)
ERROR: Could not install requirement ctrl-benchmark from https://pypi.tuna.tsinghua.edu.cn/packages/b9/87/877a378eedf805e43f1b32cbb683fb2273838f95b5f49720e3651b9b3477/ctrl-benchmark-4.9.0.tar.gz
#sha256=d21ad91f885b3d0a02a32c428627f778a6b826e0dbcb678f81252123de87cfc0 (from avalanche-lib[all]) because of HTTP error 404 Client Error: Not Found for url: https://pypi.tuna.tsinghua.edu.cn/packages/b9/87/877a378eedf805e43f1b32cbb683fb2273838f95b5f49720e3651b9b3477/ctrl-benchmark-4.9.0.tar.gz for URL https://pypi.tuna.tsinghua.edu.cn/packages/b9/87/877a378eedf805e43f1b32cbb683fb2273838f95b5f49720e3651b9b3477/ctrl-benchmark-4.9.0.tar.gz#sha256=d21ad91f885b3d0a02a32c428627f778a6b826e0dbcb678f81252123de87cfc0 (from https://pypi.tuna.tsinghua.edu.cn/simple/ctrl-benchmark/)

临时使用豆瓣镜像安装

通用语句:pip install 库 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

pip install ctrl-benchmark -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

问题解决,ctrl-benchmark库安装成功。

踩坑:直接pip install ctrl-benchmark -i http://pypi.douban.com/simple/
会遇到:

ERROR: Cannot unpack file /tmp/pip-unpack***imple (downloaded from /tmp/pip-******i5029x, content-type: text/html; charset=utf-8); cannot detect archive format
ERROR: Cannot determine archive format of /tm****ld-1xi5029x

几个国内pip源镜像

阿里云镜像:

http://mirrors.aliyun.com/pypi/simple/

豆瓣镜像:

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

清华大学镜像:

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

中国科学技术大学镜像:

http://pypi.mirrors.ustc.edu.cn/simple/

华中理工大学镜像:

http://pypi.hustunique.com/simple/pip
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值