在 Debian/Ubuntu 中没有可用的 deb 包的情况下,推荐的 pip 替代品是什么?

What is the recommended replacement for pip in Debian/Ubuntu where there is no deb package available?

sudo apt-get install trac 不再找到 trac。

sudo apt-git install pip 不再找到 pip,但 python 有命令:

python -m ensurepip 应该做同样的事情,但建议您尝试类似的事情:

sudo apt-git install python-trac 失败,因为没有这样的包。

sudo apt-get install python-pip 没有找到 pip(同样,他们禁用了它,那么他们希望我们使用的 pip 的替代品是什么)

sudo apt-get install python-pip3 确实得到了 pip3,它在用于查找 trac 时失败了,一个 python2 包,所以我不是在寻找 pip3,只是 pip for python2.

所以似乎 apt 的“超级牛”力量在这里适得其反,使安装软件包变得更加困难而不是更容易。我们现在是否需要从源代码手动安装?或者是否有一种 Debian 风格的方法可以在没有相应 Debian 软件包的 Debian 上安装 pip 软件包?

python -m ensurepip的输出如下:)

$ python -m ensurepip
ensurepip is disabled in Debian/Ubuntu for the system python.

Python modules For the system python are usually handled by dpkg and apt-get.

    apt-get install python-<module name>

Install the python-pip package to use pip itself.  Using pip together
with the system python might have unexpected results for any system installed
module, so use it on your own risk, or make sure to only use it in virtual
environments.

E: Unable to locate package python-pip 根据错误消息

的指示来自 sudo apt-get install python-pip

我不明白为什么他们禁用 pip 而不是修改 pip 以首先检查 debian 存储库,然后在 debian 中找不到软件包时回退到实际 pip。有什么想法吗?

这是 Mint 20 (Ulyana)

$ cat /etc/apt/sources.list.d/official-package-repositories.list
deb http://packages.linuxmint.com ulyana main upstream import backport

deb http://mirrors.mit.edu/ubuntu focal main restricted universe multiverse
deb http://mirrors.mit.edu/ubuntu focal-updates main restricted universe multiverse
deb http://mirrors.mit.edu/ubuntu focal-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ focal partner

(也许这就是人们从 Ubuntu & Mint 转向 MX & Manjaro 的原因)

为了将来参考,您可以使用

sudo apt-cache search pip

轻松找到重命名的包。看起来它叫做 python-pip 或 python3-pip,具体取决于您要查找的版本。

我会让你找到其他的:)

薄荷坏了。它在其他一些基于 Debian 的发行版(如 MX)中正常工作。

universe 存储库安装 python2(它在 main 存储库中不可用,不推荐使用 python3)然后安装 pip2:

sudo add-apt-repository universe
sudo apt install python2
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
sudo python2 get-pip.py

为了完美安装 pip,您必须在命令行中输入它 apt-cache 搜索 python3-pip