尝试部署python应用程序时,Heroku deploy开始返回此错误:
-----> Installing requirements with pip
Collecting amqp==2.6.1
Downloading amqp-2.6.1-py2.py3-none-any.whl (48 kB)
Collecting anyjson==0.3.3
Downloading anyjson-0.3.3.tar.gz (8.3 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status '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.
! Push rejected, failed to compile Python app.
! Push failed
requirements.txt中没有变更
2条答案
按热度按时间ioekq8ef1#
Heroku recently将Python构建包的安装工具更新为60.10.0
但是,setuptools升级也会删除对已弃用的use_2to3功能的支持,该功能可能用于少数旧依赖项版本。(发布日期:2021年9月4日),我们有意尽可能长时间地不更新,为了给予任何受影响的软件包时间来修复。但是由于pipenv兼容性问题,延迟更新不再可行。
上面的pull请求有一些选项来修复受影响的包。在我的例子中,我们不需要
anyjson
,从requirements.txt
中删除它修复了这个问题lh80um4z2#
我也遇到了同样的错误,不幸的是降级setuptools没有帮助我。在我的情况下,解决方案是卸载kombu包(ofc如果你在你的项目中不使用Celery)