我在Ubuntu 20.04上安装pip3时遇到问题

时间:2020-10-26 18:13:10

标签: python ubuntu pip

当我运行apt install python3-pip时,出现以下错误。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-26 linux-headers-5.4.0-26-generic
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libexpat1-dev libpython3-dev libpython3.8-dev python-pip-whl python3-dev
  python3-distutils python3-setuptools python3-wheel python3.8-dev zlib1g-dev
Suggested packages:
  python-setuptools-doc
The following NEW packages will be installed:
  libexpat1-dev libpython3-dev libpython3.8-dev python-pip-whl python3-dev
  python3-distutils python3-pip python3-setuptools python3-wheel python3.8-dev
  zlib1g-dev
0 upgraded, 11 newly installed, 0 to remove and 56 not upgraded.
Need to get 7,255 kB of archives.
After this operation, 27.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libexpat1-dev amd64 2.2.9-1build1
  Temporary failure resolving 'us.archive.ubuntu.com'
Ign:2 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 libpython3.8-dev amd64 3.8.2-1ubuntu1.1
Err:3 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libpython3-dev amd64 3.8.2-0ubuntu2
  Temporary failure resolving 'us.archive.ubuntu.com'
Ign:4 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python-pip-whl all 20.0.2-5ubuntu1
Err:5 http://us.archive.ubuntu.com/ubuntu focal/main amd64 zlib1g-dev amd64 1:1.2.11.dfsg-2ubuntu1
  Temporary failure resolving 'us.archive.ubuntu.com'
Ign:6 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3.8-dev amd64 3.8.2-1ubuntu1.1
Ign:7 http://us.archive.ubuntu.com/ubuntu focal/main amd64 python3-distutils all 3.8.2-1ubuntu1
Err:8 http://us.archive.ubuntu.com/ubuntu focal/main amd64 python3-dev amd64 3.8.2-0ubuntu2
  Temporary failure resolving 'us.archive.ubuntu.com'
Ign:9 http://us.archive.ubuntu.com/ubuntu focal/main amd64 python3-setuptools all 45.2.0-1
Ign:10 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-wheel all 0.34.2-1
Ign:11 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-pip all 20.0.2-5ubuntu1
Err:4 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python-pip-whl all 20.0.2-5ubuntu1
  Temporary failure resolving 'us.archive.ubuntu.com'
Err:2 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libpython3.8-dev amd64 3.8.2-1ubuntu1.1
  Temporary failure resolving 'us.archive.ubuntu.com'
Err:7 http://us.archive.ubuntu.com/ubuntu focal/main amd64 python3-distutils all 3.8.2-1ubuntu1
  Temporary failure resolving 'us.archive.ubuntu.com'
Err:6 http://security.ubuntu.com/ubuntu focal-updates/main amd64 python3.8-dev amd64 3.8.2-1ubuntu1.1
  Temporary failure resolving 'us.archive.ubuntu.com'
Err:9 http://us.archive.ubuntu.com/ubuntu focal/main amd64 python3-setuptools all 45.2.0-1
  Temporary failure resolving 'us.archive.ubuntu.com'
Err:10 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-wheel all 0.34.2-1
  Temporary failure resolving 'us.archive.ubuntu.com'
Err:11 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-pip all 20.0.2-5ubuntu1
  Temporary failure resolving 'us.archive.ubuntu.com'
Unable to correct missing packages.
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/e/expat/libexpat1-dev_2.2.9-1build1_amd64.deb  Temporary failure resolving 'us.archive.ubuntu.com'
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/python3.8/libpython3.8-dev_3.8.2-1ubuntu1.1_amd64.deb  Temporary failure resolving 'us.archive.ubuntu.com'
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python3-defaults/libpython3-dev_3.8.2-0ubuntu2_amd64.deb  Temporary failure resolving 'us.archive.ubuntu.com'
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python-pip-whl_20.0.2-5ubuntu1_all.deb  Temporary failure resolving 'us.archive.ubuntu.com'
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/z/zlib/zlib1g-dev_1.2.11.dfsg-2ubuntu1_amd64.deb  Temporary failure resolving 'us.archive.ubuntu.com'
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/python3.8/python3.8-dev_3.8.2-1ubuntu1.1_amd64.deb  Temporary failure resolving 'us.archive.ubuntu.com'
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python3-stdlib-extensions/python3-distutils_3.8.2-1ubuntu1_all.deb  Temporary failure resolving 'us.archive.ubuntu.com'
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python3-defaults/python3-dev_3.8.2-0ubuntu2_amd64.deb  Temporary failure resolving 'us.archive.ubuntu.com'
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/s/setuptools/python3-setuptools_45.2.0-1_all.deb  Temporary failure resolving 'us.archive.ubuntu.com'
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/universe/w/wheel/python3-wheel_0.34.2-1_all.deb  Temporary failure resolving 'us.archive.ubuntu.com'
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python3-pip_20.0.2-5ubuntu1_all.deb  Temporary failure resolving 'us.archive.ubuntu.com'
E: Aborting install.

我是在Linux上使用python的新手,所以它可能是一个简单的修复程序,但我不知道:)可能是因为我使用的是旧版本的python。我确实更新了apt库。 我希望有人可以帮助我了解导致此错误的原因。 预先感谢!

1 个答案:

答案 0 :(得分:0)

我的网络连接似乎有问题。我重置了网络设置,并且可以正常工作。