首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在部署到Heroku时找不到包'gobject-introspection-1.0‘

在部署到Heroku时找不到包'gobject-introspection-1.0‘
EN

Stack Overflow用户
提问于 2018-11-18 23:56:48
回答 1查看 1.8K关注 0票数 1

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

代码语言:javascript
复制
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'

OS = Ubuntu 18.04(仿生) Python 3.7.1

在requirements.txt中:

pycairo==1.18.0 PyGObject==3.30.2

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

代码语言:javascript
复制
$ whereis gobject-introspection-1.0
gobject-introspection-1: /usr/include/gobject-introspection-1.0 /usr/share/gobject-introspection-1.

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

EN

回答 1

Stack Overflow用户

发布于 2018-11-27 15:43:58

手动编辑包含以下内容的requirement.txt文件后;

代码语言:javascript
复制
Flask
gunicorn

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53362778

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档