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

前言

pip 安装 anyjson==0.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就不会报错了

posted @   上海-悠悠  阅读(6915)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
点击右上角即可分享
微信分享提示