0

升级 Debian 后,我不能再使用 pip(想用它来安装pipenv从而正确管理我的 virtualenvs……)。

我用这个命令安装了 pip3:

apt-get install python3-pip

以下是 pip3 抱怨的方式:

$ pip3

Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 78, in <module>
    raise RuntimeError("Python 3.3 or later is required")
RuntimeError: Python 3.3 or later is required

这是由此签入导致的/usr/lib/python3/dist-packages/pkg_resources/__init__.py

if (3, 0) < sys.version_info < (3, 3):
    raise RuntimeError("Python 3.3 or later is required")

但:

$ python3 --version

Python 3.5.3

和:

$ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version_info
sys.version_info(major=3, minor=5, micro=3, releaselevel='final', serial=0)
>>>

似乎 pip3 在我的 debian 服务器上安装的 Python 2 和 Python 3 之间令人困惑。

你有没有遇到过这个问题?

4

2 回答 2

1

只需做一个python3 -m pip install -U --force-reinstall pip.

谢谢克努德·拉森!

于 2018-06-03T17:26:36.473 回答
0

apt-get 安装 python3-pip :

那是 /usr/bin/pip3 https://packages.debian.org/stretch/all/python3-pip/filelist

...而且您还有另一个版本 /usr/local/bin/pip3。也许来自您以前的 Debian 版本。

于 2018-06-03T20:31:25.220 回答