[英]Trying to deploy API on Heroku issue Preparing metadata (pyproject.toml) did not run successfully
I'm using Python 3.9.2.我正在使用 Python 3.9.2。 to develop a Flask API and my code runs fine and I'm able to run the API locally and return the expected data but I want to deploy it to for more testing.
开发 Flask API 并且我的代码运行良好,我能够在本地运行 API 并返回预期的数据,但我想将其部署到更多测试。
I've tried downgrading my version of Numpy in requirements.txt but still getting same error.我尝试在 requirements.txt 中降级我的 Numpy 版本,但仍然出现相同的错误。
Preparing metadata (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [123 lines of output]
setup.py:461: UserWarning: Unrecognized setuptools command ('dist_info --egg-base /tmp/pip-modern-metadata-anq37ukt'), proceeding with generating Cython sources and expanding templates
warnings.warn("Unrecognized setuptools command ('{}'), proceeding with "
setup.py:563: DeprecationWarning:
`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
in your requirements.txt
try to set a lower version of setuptools
and numpy
as reported by the error message在您的
requirements.txt
中尝试设置错误消息所报告的较低版本的setuptools
和numpy
requirements.txt :要求.txt :
...
setuptools==59.8.0
numpy==1.19.2
...
The issue was with the Python version that Heroku was using to build the app.问题在于 Heroku 用于构建应用程序的 Python 版本。 I created a runtime.txt file and specified Python 3.9.12 which fixed the issue.
我创建了一个 runtime.txt 文件并指定了修复该问题的 Python 3.9.12。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.