【问题标题】:No package 'gobject-introspection-1.0' found while deploying to Heroku部署到 Heroku 时找不到包“gobject-introspection-1.0”
【发布时间】:2018-11-18 15:56:48
【问题描述】:

尝试将python web应用部署到heroku,但遇到以下错误:

remote:            running build_ext
remote:            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-l6sq2i_i/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-k7lo0r2b-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-l6sq2i_i/PyGObject/
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to ggoh-trailer.
remote: 
To https://git.heroku.com/ggoh-trailer.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/ggoh-trailer.git'

操作系统 = Ubuntu 18.04(仿生) Python 3.7.1

在 requirements.txt 中:

pycairo==1.18.0 PyGObject==3.30.2

我已经安装了 libgirepository1.0-dev,如下所示;

$ whereis gobject-introspection-1.0
gobject-introspection-1: /usr/include/gobject-introspection-1.0 /usr/share/gobject-introspection-1.

但我仍然看到上面相同的错误。我需要在 Ubuntu 上安装其他应用程序来满足依赖关系吗?

【问题讨论】:

  • 这与您本地的 Ubuntu 机器无关:错误发生在 Heroku 上。你用开罗做什么?

标签: python ubuntu heroku


【解决方案1】:

手动编辑 requirements.txt 文件后,内容如下;

Flask
gunicorn

Heroku 能够接受我的 git push。我学会了只在require.txt 中使用所需的依赖项。感谢 Chris 为我指明了正确的方向。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-08-04
    • 2023-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-20
    • 2019-08-21
    相关资源
    最近更新 更多