Heroku pip install 突然开始返回错误:use_2to3 is invalid

ahm*_*med 3 python pip heroku setuptools

尝试部署 python 应用程序时,Heroku 部署开始返回此错误:

\n
-----> Installing requirements with pip\n       Collecting amqp==2.6.1\n         Downloading amqp-2.6.1-py2.py3-none-any.whl (48 kB)\n       Collecting anyjson==0.3.3\n         Downloading anyjson-0.3.3.tar.gz (8.3 kB)\n         Preparing metadata (setup.py): started\n         Preparing metadata (setup.py): finished with status 'error'\n         error: subprocess-exited-with-error\n         \n         \xc3\x97 python setup.py egg_info did not run successfully.\n         \xe2\x94\x82 exit code: 1\n         \xe2\x95\xb0\xe2\x94\x80> [1 lines of output]\n             error in anyjson setup command: use_2to3 is invalid.\n             [end of output]\n         \n         note: This error originates from a subprocess, and is likely not a problem with pip.\n       error: metadata-generation-failed\n       \n       \xc3\x97 Encountered error while generating package metadata.\n       \xe2\x95\xb0\xe2\x94\x80> See above for output.\n       \n       note: This is an issue with the package mentioned above, not pip.\n       hint: See above for details.\n !     Push rejected, failed to compile Python app.\n !     Push failed\n
Run Code Online (Sandbox Code Playgroud)\n

requirements.txt 没有变化

\n

ahm*_*med 5

Heroku最近将 python 构建包的 setuptools 更新到了 60.10.0

但是,setuptools 升级还删除了对已弃用的 use_2to3 功能的支持,该功能可能会用于少数旧版依赖项版本。此更改发生在 setuptools 58.0.0(2021 年 9 月 4 日发布)中,我们故意尽可能长时间不更新该版本,以便为任何受影响的软件包提供修复时间。然而,由于 Pipenv 兼容性问题,不再可行地延迟更新。

上述拉取请求有一些选项可以修复受影响的包。就我而言,无论如何我们都不需要anyjson,将其从requirements.txt解决问题中删除