赞
踩
错误如下:
Collecting anyjson==0.3.2
Downloading anyjson-0.3.2.tar.gz (9.4 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
error in anyjson setup command: use_2to3 is invalid.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
经过分析得出:
pip 安装 anyjson==0.3.3 版本时报错 error in anyjson setup command: use_2to3 is invalid.
当然在安装其他版本时也会有这种报错,比如安装 django-celery==3.2.2版本,它会先安装依赖包anyjson
主要原因是在setuptools 58之后的版本已经废弃了use_2to3
解决办法:
降低setuptools版本于50一下
pip install setuptools==50.3.2
然后执行pip install anyjson== 0.3.3
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。