【问题标题】:No package found error while pushing to heroku a flask app将烧瓶应用程序推送到 heroku 时未找到包错误
【发布时间】:2020-05-19 14:50:29
【问题描述】:

我正在尝试在 Heroku 上部署一个 Flask 应用程序,该应用程序在对大型 JSON 数据集进行一些数据分析后响应 JSON 发布请求。我提到了这个问题:No package 'gobject-introspection-1.0' found while deploying to Heroku 但它仍然不起作用。

requirements.txt:

flask
pandas
gunicorn
flask_cors
gdown
Package gobject-introspection-1.0 was not found in the pkg-config search path.
remote:            Perhaps you should add the directory containing `gobject-introspection-1.0.pc'
remote:            to the PKG_CONFIG_PATH environment variable
remote:            No package 'gobject-introspection-1.0' found
remote:            Command '('pkg-config', '--print-errors', '--exists', 'gobject-introspection-1.0 >= 1.46.0')' returned non-zero exit status 1.
remote:            
remote:            Try installing it with: 'sudo apt install libgirepository1.0-dev'
remote:            
remote:            ----------------------------------------
remote:        Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3ejh6vw4/PyGObject/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-lgaouqha-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-3ejh6vw4/PyGObject/
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to stormy-castle-60587.

【问题讨论】:

  • 您可以尝试使用heroku run bash --app appname 联系您的slug,然后尝试安装libgirepository1.0-dev。如果失败,请使用heroku-community/apt,更多信息请访问:elements.heroku.com/buildpacks/heroku/heroku-buildpack-apt
  • 感谢成功,我成功部署了我的 Flask 应用
  • 好的,我已将我的评论转换为答案。如果您觉得有帮助,请接受并投票。

标签: python heroku flask


【解决方案1】:

您可以尝试使用heroku run bash --app appname 联系您的slug,然后尝试安装libgirepository1.0-dev。如果失败,请使用heroku-community/apt,更多信息请访问heroku-buildpack-apt

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-01
    • 2012-06-16
    • 1970-01-01
    • 1970-01-01
    • 2022-07-17
    • 1970-01-01
    相关资源
    最近更新 更多