linux - Pip 没有链接到我升级的 Python 版本。包 python3-pip 不可用,但被另一个包引用

标签 linux pip

将 pip 链接到 python 3.7 时遇到问题。 pip 和 pip3 都已安装,但链接到 Python 2.7。

我试图重新安装 Python3,然后 pip 没有任何进展。

我收到以下消息:

Package python3-pip is not available, but is referred to by another package.



这可能意味着软件包丢失、已过时或
只能从其他来源获得

$ python --version
Python 3.7.4

$ pip -V
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
pip 19.2.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

$ pip3 -V
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
pip 19.2.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)


$ sudo apt-get install python3-pip
[sudo] password for TarikDev: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python3-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3-pip' has no installation candidate

最佳答案

首先使用这个命令

sudo apt-get update
将下载两个包,大小为 16 MB。然后:
sudo apt-get install python2-pip

关于linux - Pip 没有链接到我升级的 Python 版本。包 python3-pip 不可用,但被另一个包引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57367630/

相关文章:

python - 将生产中的所有 python 包升级到最新版本是一个好习惯吗?

linux - 如何/在何处为 IP 地址添加 rDNS

linux - 如何使用命令行控制 libreOffice 中的幻灯片放映?

linux - Ubuntu VM 上 Docker 容器中的假输入设备

django - 安装numpy和pandas时如何处理heroku `Timed out compiling Python app`

python - 无法删除python pip

python - Qt 启动画面未在 python 中显示

xml - 将显示 XML 编码的 Linux 脚本

python - pip 从 url 安装包

python - 从test.pypi安装自己的软件包时如何修复 "No matching distribution found for {package name}"