将 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/