简体   繁体   English

尝试在 Heroku 问题上部署 API 准备元数据 (pyproject.toml) 未成功运行

[英]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中尝试设置错误消息所报告的较低版本的setuptoolsnumpy

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.

相关问题 Windows 10,数据表安装问题“准备元数据 (pyproject.toml) 未成功运行。” - Windows 10, Datatable install issue 'Preparing metadata (pyproject.toml) did not run successfully.' 使用 pip 安装 pytq5 时出错:准备元数据 (pyproject.toml) 未成功运行 - Error while installing pytq5 with pip: Preparing metadata (pyproject.toml) did not run successfully gevent (pyproject.toml) 的构建轮未成功运行 - Building wheel for gevent (pyproject.toml) did not run successfully Scikit-learn 安装 - 准备元数据 (pyproject.toml)... 错误 - Scikit-learn installation - Preparing metadata (pyproject.toml) ... error Pyproject.toml 的强盗问题 - Bandit Issue with Pyproject.toml 在 VS 代码上安装 numpy 时出现“正在准备元数据 (pyproject.toml)...错误” - 'Preparing metadata (pyproject.toml) ... error' when installing numpy on VS code pyproject.toml 的诗歌问题“诗歌在 D:\... 中找不到 pyproject.toml 文件” - Poetry issue with pyproject.toml "Poetry could not find a pyproject.toml file in D:\..." 'tox' 和 'pyproject.toml' - 'tox' and 'pyproject.toml' Heroku 部署失败 | 既没有找到“setup.py”也没有找到“pyproject.toml”。 有谁知道如何解决这一问题? - Heroku fails to deploy | neither 'setup.py' nor 'pyproject.toml' found. Does anyone know how to fix this? 在 pyproject.toml 中连接 2 个数组 - Concatenate 2 arrays in pyproject.toml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM