pip安装错误命令“ python setup.py egg_info”失败,错误代码为1

时间:2019-07-03 10:34:07

标签: pip failed-installation

我正在尝试使用以下命令在Ubuntu终端上安装Monkeytype:

pip install monkeytype 

但是我收到一个错误消息:

Command "python setup.py egg_info" failed with error code 1 

这是完整的日志:

bash-4.3$ pip install monkeytype
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting monkeytype
  Using cached https://files.pythonhosted.org/packages/5f/59/43bc6e44d69bd268e545fdfacdd6866362aca57ac894bbc3177b5455c06a/MonkeyType-18.2.0.tar.gz
Collecting retype (from monkeytype)
  Using cached https://files.pythonhosted.org/packages/6e/da/ca9f5560f051d2ed79a52de1170903e3ff8ad011cff56c65abfcff38d372/retype-17.12.0.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-mCIobj/retype/setup.py", line 14, in <module>
        assert sys.version_info >= (3, 6, 0), "retype requires Python 3.6+"
    AssertionError: retype requires Python 3.6+
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-mCIobj/retype/

3 个答案:

答案 0 :(得分:2)

使用pip install时,真正的错误总是隐藏在日志的后面,因为pip运行软件包的安装例程。

在您的情况下,请检查ERROR: Traceback,它表示“重新输入要求Python 3.6 +”。

因此,已安装的软件包需要Python 3.6,但从先前的错误消息中,我们可以推断出您的pip运行python 2.7(查找DEPRECATION: Python 2.7

因此,通过使用pip3python3 pip运行命令来修复错误。

要验证使用的是哪个版本的python,请调用pip -V

答案 1 :(得分:0)

检查错误列表,搜索类似“警告:车轮包装不可用”的行。或类似的东西。 单独安装每个缺少的软件包都可以解决问题。

答案 2 :(得分:0)

sudo pip3 install --upgrade setuptools

将其复制并粘贴到终端中。

相关问题