【问题标题】:Error while downloading the requirements using pip install (setup command: use_2to3 is invalid.)使用 pip install 下载需求时出错(安装命令:use_2to3 无效。)
【发布时间】:2021-11-05 01:30:10
【问题描述】:

版本 pip 21.2.4 蟒蛇3.6

命令:

pip install -r  requirments.txt

我的requirements.txt的内容:

mongoengine==0.19.1
numpy==1.16.2
pylint
pandas==1.1.5
fawkes

命令失败并出现此错误

ERROR: Command errored out with exit status 1:
     command: /Users/*/Desktop/ml/*/venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kn/0y92g7x55qs7c42tln4gwhtm0000gp/T/pip-install-soh30mel/mongoengine_89e68f8427244f1bb3215b22f77a619c/setup.py'"'"'; __file__='"'"'/private/var/folders/kn/0y92g7x55qs7c42tln4gwhtm0000gp/T/pip-install-soh30mel/mongoengine_89e68f8427244f1bb3215b22f77a619c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/kn/0y92g7x55qs7c42tln4gwhtm0000gp/T/pip-pip-egg-info-97994d6e
         cwd: /private/var/folders/kn/0y92g7x55qs7c42tln4gwhtm0000gp/T/pip-install-soh30mel/mongoengine_89e68f8427244f1bb3215b22f77a619c/
    Complete output (1 lines):
    error in mongoengine setup command: use_2to3 is invalid.
    ----------------------------------------
WARNING: Discarding https://*/pypi/packages/mongoengine-0.19.1.tar.gz#md5=68e613009f6466239158821a102ac084 (from https://*/pypi/simple/mongoengine/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mongoengine==0.19.1 (from versions: 0.15.0, 0.19.1)
ERROR: No matching distribution found for mongoengine==0.19.1

【问题讨论】:

    标签: python python-3.x pip setuptools


    【解决方案1】:

    看起来setuptools>=58 破坏了对use_2to3 的支持:

    setuptools changelog for v58

    因此您应该将setuptools 更新为setuptools<58 或避免在设置参数中使用带有use_2to3 的软件包。

    我也遇到了同样的问题,pip==19.3.1

    【讨论】:

      【解决方案2】:

      将 MongoEngine 升级到 >= 0.20 也可以解决问题,因为 Python2 支持(因此 use_2to3)在 0.20 中被删除

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-01-05
        • 2022-06-14
        • 2020-11-27
        • 1970-01-01
        • 2022-01-17
        • 2021-09-21
        • 2017-06-17
        相关资源
        最近更新 更多