使用 pip install 下载需求时出错(设置命令:use_2to3 无效.) [英] Error while downloading the requirements using pip install (setup command: use_2to3 is invalid.)

查看:54
本文介绍了使用 pip install 下载需求时出错(设置命令:use_2to3 无效.)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

版本 pip 21.2.4蟒蛇 3.6

version pip 21.2.4 python 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('"'"'
'"'"', '"'"'
'"'"');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

推荐答案

看起来 setuptools>=58 中断了对 use_2to3 的支持:

It looks like setuptools>=58 breaks support for use_2to3:

v58 的设置工具更新日志

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

So you should update setuptools to setuptools<58 or avoid using packages with use_2to3 in the setup parameters.

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

这篇关于使用 pip install 下载需求时出错(设置命令:use_2to3 无效.)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆