python测试开发django-189.安装celery==3.1.26.post2版本报错No matching distribution found for anyjson>=0.3.3

前言

使用环境:
python 3.8
django 2.1.2
celery 3.1.26.post2

celery 版本安装

在安装celery版本 的时候报错No matching distribution found for anyjson>=0.3.3

Requirement already satisfied: kombu<3.1,>=3.0.37 in d:\django38\hrun2_web\venv\lib\site-packages (from
 celery==3.1.26.post2) (3.0.37)
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.

出现报错是安装anyjson>=0.3.3失败了。
具体原因是 setuptools从版本58.0.0开始不再支持2to3的builds,所以导致 anyjson 安装后不再可用。
解决问题办法,降级 setuptools 工具版本即可。

降级 setuptools

先查看当前安装的 setuptools 工具版本号Version: 61.3.1

>pip show setuptools
Name: setuptools
Version: 61.3.1
Summary: Easily download, build, install, upgrade, and uninstall Python packages
Home-page: https://github.com/pypa/setuptools
Author: Python Packaging Authority
Author-email: distutils-sig@python.org
License: UNKNOWN
Location: d:\django38\hrun2_web\venv\lib\site-packages
Requires:
Required-by: jsonschema

降级版本

>pip install --upgrade setuptools==57.5.0

接着就可以成功安装celery==3.1.26.post2

>pip install celery==3.1.26.post2
posted @   上海-悠悠  阅读(1679)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
历史上的今天:
2020-04-03 pytest文档34-Hooks函数改变用例执行顺序(pytest_collection_modifyitems)
2019-04-03 python测试开发django-46.xadmin添加action动作
2019-04-03 python测试开发django-45.xadmin添加小组件报错解决
2019-04-03 python测试开发django-44.xadmin自定义菜单项
2018-04-03 selenium+python自动化94-行为事件(ActionChains)源码详解
点击右上角即可分享
微信分享提示