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

Tar*_*007 4 linux pip

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

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

我收到以下消息:

包 python3-pip 不可用,但被另一个包引用。

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

$ 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
Run Code Online (Sandbox Code Playgroud)

小智 13

我尝试过这个,它对我有用:

# Download current package information.
sudo apt-get update.

# Install a new package.
sudo apt-get install python3-pip

# Test the package install.
pip -V
Run Code Online (Sandbox Code Playgroud)


小智 8

首先使用这个命令

sudo apt-get update
Run Code Online (Sandbox Code Playgroud)

将下载两个包,大小为 16 MB。然后:

sudo apt-get install python2-pip
Run Code Online (Sandbox Code Playgroud)