简体   繁体   English

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

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

sudo apt-get install trac no longer finds trac. sudo apt-get install trac不再找到 trac。

sudo apt-git install pip no longer finds pip, but python has the command: sudo apt-git install pip不再找到 pip,但 python 有命令:

python -m ensurepip that is supposed to do the same thing but instead advises you to try something like: python -m ensurepip应该做同样的事情,但建议你尝试类似的事情:

sudo apt-git install python-trac which fails because there is no such package. sudo apt-git install python-trac失败,因为没有这样的 package。

sudo apt-get install python-pip doesn not find pip (again, they disabled it, so what is the ALTERNATIVE to pip that they want us to use) sudo apt-get install python-pip没有找到 pip (同样,他们禁用了它,那么他们希望我们使用的 pip 的替代品是什么)

sudo apt-get install python-pip3 does get pip3 which fails when used to find trac, a python2 package, so I'm not looking for pip3, just pip for python2. sudo apt-get install python-pip3确实得到了 pip3,它在用于查找 trac 时失败,一个 python2 package,所以我不是在寻找 pip3,只是在寻找 python2 的 pip。

So it seems the "super-cow" powers of apt are backfiring here making it more difficult rather than easier to install packages.因此,似乎 apt 的“超级牛”功能在这里适得其反,使得安装软件包变得更加困难而不是更容易。 Do we need to be resort to manual installation from source now?我们现在需要从源头手动安装吗? Or is there a Debian-style way of installing pip packages on Debian that don't have corresponding Debian packages?或者是否有一种 Debian 风格的方法可以在没有相应 Debian 软件包的 Debian 上安装 pip 软件包?

(The output of python -m ensurepip is below:) python -m ensurepip的 output 如下:)

$ 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 results from sudo apt-get install python-pip as directed by the error message E: Unable to locate package python-pip结果来自sudo apt-get install python-pip的错误信息指示

I don't see why they disable pip rather than modifying pip to check the debian repos first and then falling back on actual pip when the package is not found in debian. I don't see why they disable pip rather than modifying pip to check the debian repos first and then falling back on actual pip when the package is not found in debian. Any idea on that?对此有任何想法吗?

This is for Mint 20 (Ulyana)这是薄荷 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

(Maybe this is why people are moving from Ubuntu & Mint to MX & Manjaro) (也许这就是人们从 Ubuntu & Mint 转向 MX & Manjaro 的原因)

For future reference, you can use为了将来参考,您可以使用

sudo apt-cache search pip sudo apt-cache search pip

to find renamed packages easily.轻松找到重命名的包。 Looks like its called python-pip or python3-pip depending on the version you're looking for.看起来它被称为 python-pip 或 python3-pip,具体取决于您要查找的版本。

I'll let you find the others:)我会让你找到其他的:)

Install python2 from universe repository (it is not available in the main repository, it is deprecated on favor of python3 ) then install pip2 :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

Mint is broken.薄荷坏了。 It works properly in some other Debian based distros like MX.它在其他一些基于 Debian 的发行版(如 MX)中正常工作。

for the perfect installation of pip you must type its in your command line apt-cache search python3-pip为了完美安装 pip,您必须在命令行中键入它 apt-cache search python3-pip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM