No package 'gobject-introspection-1.0' found while deploying to Heroku

断了今生、忘了曾经 提交于 2021-01-28 08:13:50

问题


Attempted to deploy python web app to heroku but encountered the following errors:

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(Bionic) Python 3.7.1

In requirements.txt:

pycairo==1.18.0 PyGObject==3.30.2

I've installed libgirepository1.0-dev as below;

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

But I still see the same error above. Are there any other applications that I need to install on Ubuntu to fulfill the dependency?


回答1:


After manually editing requirement.txt files with content below;

Flask
gunicorn

Heroku was able to accept my git push. I've learned to only use the required dependencies in requirement.txt. Thanks Chris for point me to the right direction.



来源:https://stackoverflow.com/questions/53362778/no-package-gobject-introspection-1-0-found-while-deploying-to-heroku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!