Ubuntu 16:pip3 安装到 Python2 而不是 Python3

Ubuntu 16:pip3 安装到 Python2 而不是 Python3

将 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

相关内容