使用代理在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 file not found’。

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

 sudo apt-get -y install python3-pip 

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

 sudo apt-get update 

如果第一次没有工作,那么你也可以使用curl来做到这一点

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

然后validation安装试试

 pip3 --help 

用于检查版本:

 pip3 --version 

我通过更改“软件和更新”中的服务器 – >从下载中解决了这个问题:我选择了不同的地址,404消失了。

什么对我有用

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