更换pip源

在使用pip安装某些包时或者是安装某些插件出现

ERROR: Could not find a version that satisfies the requirement 插件名字 (from versions: none)
ERROR: No matching distribution found for 插件名字

这种情况的时候
两种解决办法

1.可能是pip的版本过低,升级版本

一般会提示

WARNING: You are using pip version 22.0.4; however, version 22.2.2 is available.
You should consider upgrading via the 'D:\python\env\python3.exe -m pip install --upgrade pip' command.

这时候使用python3.exe -m pip install --upgrade pip升级就行了

2.可能是镜像源的问题,换一个镜像源试一试

切换到国内的镜像源
(1)阿里云 http://mirrors.aliyun.com/pypi/simple/
(2)豆瓣http://pypi.douban.com/simple/
(3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
(4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
(5)华中科技大学http://pypi.hustunique.com/

这里设置为阿里云镜像源

python3 -m pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/

这时候有可能会提示

WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'

此时提示你在后面加上–trusted-host mirrors.aliyun.com信任
使用
python3 -m pip install nb-cli --trusted-host mirrors.aliyun.com安装

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值