使用代理在 ubuntu 16.04 LTS 上安装 pip3(适用于 python3)

使用代理在 ubuntu 16.04 LTS 上安装 pip3(适用于 python3)

我曾尝试输入:

sudo apt install python3-pip

我收到的错误是:

$ sudo apt install python3-pip  
Reading package lists... Done 
Building dependency tree        
Reading state information... Done 
The following additional packages will be installed:
    libexpat1-dev libpython3-dev libpython3.5-dev python-pip-whl python3-dev python3-wheel python3.5-dev 
The following NEW packages will be installed:
    libexpat1-dev libpython3-dev libpython3.5-dev python-pip-whl python3-dev python3-pip python3-wheel python3.5-dev 0 to upgrade, 8 to newly install, 0 to remove and 0 not to upgrade. 
Need to get 1,219 kB/39.1 MB of archives. 
After this operation, 56.8 MB of additional disk space will be used. 
Do you want to continue? [Y/n] y 
Ign:1 au.archive.ubuntu.com/ubuntu xenial-updates/universe i386 python-pip-whl all 8.1.1-2ubuntu0.1 
Ign:2 au.archive.ubuntu.com/ubuntu xenial-updates/universe i386 python3-pip all 8.1.1-2ubuntu0.1 
Err:1 au.archive.ubuntu.com/ubuntu xenial-updates/universe i386 python-pip-whl all 8.1.1-2ubuntu0.1
    404  Not Found 
Err:2 au.archive.ubuntu.com/ubuntu xenial-updates/universe i386 python3-pip all 8.1.1-2ubuntu0.1
    404  Not Found
E: Failed to fetch http://au.archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python-pip-whl_8.1.1-2ubuntu0.1_all.deb 
    404  Not Found
E: Failed to fetch http://au.archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python3-pip_8.1.1-2ubuntu0.1_all.deb
    404  Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

我相信我们已经绕过了代理,所以我不确定为什么我会收到“404 文件未找到”的错误。

答案1

您遵循的第一个程序是正确的

sudo apt-get -y install python3-pip

但在安装之前尝试使用命令进行更新

sudo apt-get update

如果第一次不起作用,那么您也可以使用卷曲

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python3 get-pip.py --user

然后验证安装尝试

pip3 --help 

检查版本:

pip3 --version 

答案2

我通过更改“软件和更新”中的服务器解决了此问题 - >下载自:在那里我选择了不同的地址并且 404 消失了。

答案3

对我有用

curl -sS https://bootstrap.pypa.io/get-pip.py >>setup.py
python3 setup.py

相关内容