当前位置: 首页>>技术教程>>正文


apt – 使用代理在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文件未找到”。

最佳答案

您遵循的第一个步骤是正确的

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

然后验证安装尝试

pip3 --help 

对于版本检查:

pip3 --version 

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/11642.html,未经允许,请勿转载。