ERROR: HTTP error 403 while getting https://pypi.tuna.tsinghua.edu.cn/packages

更新日期: 2025-03-15 阅读次数: 226 字数: 165 分类: Python

使用清华的 python 源 pip install 失败,报错:

ERROR: HTTP error 403 while getting https://pypi.tuna.tsinghua.edu.cn/packages

据说是因为清华源不是 https 的,而 python 禁用了 http 的访问。

更换为阿里云的 python 源

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

PermissionError: [Errno 13] Permission denied

如果设置时报错,应该是需要使用管理员权限执行。但是,切换为管理员启动命令行,也不行。

在命令后面加上 --user 就好了。

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

再次执行 pip install xxx 就可以正常下载安装了。

参考

  • https://tencentcloud.csdn.net/67875282edd0904849a520ae.html

微信关注我哦 👍

大象工具微信公众号

我是来自山东烟台的一名开发者,有感兴趣的话题,或者软件开发需求,欢迎加微信 zhongwei 聊聊, 查看更多联系方式