Heroku deploy 在嘗試部署 python 應用程式時開始回傳此錯誤:
-----> 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 沒有變化
uj5u.com熱心網友回復:
Heroku最近將 python 構建包的 setuptools 更新為 60.10.0
但是,setuptools 升級也放棄了對已棄用的 use_2to3 功能的支持,該功能可能用于少量的舊依賴版本。此更改發生在 setuptools 58.0.0(2021 年 9 月 4 日發布)中,我們故意盡可能長時間地不更新,以便讓任何受影響的軟體包有時間修復。然而,由于 pipenv 兼容性問題,不再延遲更新不再可行。
上面的拉取請求有一些選項來修復受影響的包。就我而言,無論如何我們都不需要anyjson,將其從requirements.txt已解決的問題中洗掉
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/467615.html
