其他分享
首页 > 其他分享> > pip 安装报错 error in anyjson setup command: use_2to3 is invalid.

pip 安装报错 error in anyjson setup command: use_2to3 is invalid.

作者:互联网

前言

pip 安装anyjson0.3.3版本时报错 error in anyjson setup command: use_2to3 is invalid.
当然在安装其他版本时也会有这种报错,比如安装django-celery
3.2.2版本,它会先安装依赖包anyjson
主要原因是在setuptools 58之后的版本已经废弃了use_2to3

anyjson 安装

pip 安装

pip install anyjson==0.3.3

报错内容

Collecting anyjson==0.3.3
  Using cached anyjson-0.3.3.tar.gz (8.3 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.

主要因为在setuptools 58之后的版本已经废弃了use_2to3

解决办法

解决办法只需安装setuptools 低于58版本就可以了

pip install setuptools==50.3.2

降低setuptools 版本后,pip 安装anyjson==0.3.3就不会报错了

标签:use,setup,报错,setuptools,error,pip,anyjson,安装
来源: https://www.cnblogs.com/yoyoketang/p/16455708.html