报错信息 

 ERROR: HTTP error 403 while getting https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/52/79/a64937a2185b91a96cc5406e3ea58120980c725543d047e112fb3084a972/fake_useragent-2.0.0-py3-none-any.whl (from https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/fake-useragent/)

解决办法 

方法一:

临时更改镜像源(阿里镜像源)

 Package更换为自己所需安装的包

pip install -i http://mirrors.aliyun.com/pypi/simple Package --trusted-host mirrors.aliyun.com

方法二 

永久更换源(阿里镜像源)

pip config set global.index-url http://mirrors.aliyun.com/pypi/simple
pip config set install.trusted-host mirrors.aliyun.com

 方法三

配置多个镜像源(方法二设置后为默认镜像源,这里多个两个镜像源平衡负载,分别是清华大学源、豆瓣源)

pip config set global.extra-index-url "https://pypi.tuna.tsinghua.edu.cn/simple http://pypi.douban.com/simple"

 配置多个可信任主机(域名),分别为阿里、清华大学、豆瓣镜像域名

pip config set install.trusted-host "mirrors.aliyun.com mirrors.tuna.tsinghua.edu.cn pypi.douban.com"

最后清除缓存及时生效(方法二、方法三用到)

pip cache purge

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐