E: 无法下载 https://mirrors.aliyun.com/ubuntu/.../python3-setuptools_59.6.0-1.2ubuntu 错误 403 禁止访问
·
1.笔者所用Ubuntu版本如下,这里想安装pip3
2.下载源 /etc/apt/sources.list
可在阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区查找对应版本
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
# deb https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
3.开始安装pip3
python3 --version 查看python版本
sudo apt upgrade 更新 Ubuntu 的包索引
这里报错:
E: 无法下载 https://mirrors.aliyun.com/ubuntu/pool/main/s/setuptools/python3-setuptools59.6.0-1.2ubuntu0.22.04.2all.deb,出现403禁止访问错误 [IP: xxx 443] E: 无法下载 https://mirrors.aliyun.com/ubuntu/pool/universe/w/wheel/python3-wheel0.37.1-2ubuntu0.22.04.1all.deb,出现403禁止访问错误 [IP: xxx 443] E: 无法下载 https://mirrors.aliyun.com/ubuntu/pool/universe/p/python-pip/python3-pip22.0.2%2bdfsg-1ubuntu0.5all.deb,出现403禁止访问错误 [IP: xxxx 443] E: 有几个软件包无法下载,您是否想要运行 apt-get update 或者尝试添加 --fix-missing 选项后再试一次?
这里应该是因为开了代理,把代理关闭
尝试刷新 apt 并修复:这个命令会修复损坏的依赖项,并重新尝试安装 pip3
sudo apt update --fix-missing
sudo apt upgrade
sudo apt install python3-pip 安装pip3
查看是否安装成功:
xxx@xxx-mac:~$ pip3 --version
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)