【问题标题】:“E: Unable to locate package python3-pip” in Debian 10Debian 10 中的“E:无法找到包 python3-pip”
【发布时间】:2020-12-27 12:10:00
【问题描述】:

为了安装 pip3,我正在关注 apt update 过程。 但我在终端得到输出:

$ sudo apt-get update 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-pip

在 stackoverflow 上尝试了所有可用的解决方案。 请提出任何解决方案。

【问题讨论】:

    标签: python-3.x pip debian


    【解决方案1】:

    有时sources.list 文件配置不正确,所以如果没有解决方案有效,请尝试以下操作: 输入终端,gedit etc/apt/sources.list。将打开一个文件,检查该文件中是否存在这些给定的行:

    deb http://deb.debian.org/debian buster main
    deb-src http://deb.debian.org/debian buster main
    
    deb http://deb.debian.org/debian-security/ buster/updates main
    deb-src http://deb.debian.org/debian-security/ buster/updates main
    
    deb http://deb.debian.org/debian buster-updates main
    deb-src http://deb.debian.org/debian buster-updates main
    

    在我的情况下,这些都丢失了,这意味着 apt-get 命令没有配置镜像来拉取和更新包。这些行是 Debian 存储库的链接,从中提取软件包。 将这些行复制并粘贴到该文件中,然后保存并关闭它。 现在运行sudo apt-get update,然后运行sudo apt-get upgrade。一旦进程完成运行sudo apt-get install -y python3-pip。这将安装 pip3 而不会出现任何错误。

    【讨论】:

      【解决方案2】:

      请运行更新和升级,

      sudo apt update && sudo apt upgrade 
      

      希望这能解决问题。如果这不起作用,您可以随时手动更新源列表。

      【讨论】:

      • 谢谢,我必须手动更新源列表。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-01-20
      • 2019-08-20
      • 1970-01-01
      • 2021-12-06
      • 1970-01-01
      • 1970-01-01
      • 2020-11-11
      相关资源
      最近更新 更多