简体   繁体   中英

Failed to install PyGObject in heroku

I have struggled last day to install PyGObject in a python project on Heroku, but with no luck.

I have also made an empty Heroku app, but I couldn't install it there either. (tried with pip from inside heroku bash, or in requirments file, always the same error: https://pastebin.com/RcJvC9MJ )

I have also tried to install it via the apt buildpack, but it doesn't seems to install. My apt file contained the packages from pygobjectgetting started python3-gi python3-gi-cairo gir1.2-gtk-3.0 . During the build phase, they seem to install fine, but the app doesn't see pygobject.

When trying to install with pip, it gives the following error: https://pastebin.com/RcJvC9MJ . I have tried to manually install pkg-config (by adding it in the Aptfile), but then another package is not found ( https://pastebin.com/SuVR25Ei ). I have then repeated the process (by adding the new package to the Aptfile). I have spent some time just adding more packages to the aptfile, and now it has ~300 of packages (generated using apt dependencies), but still no luck. (Everytime there is some package that needs to be installed)

I have also tried to remove '~/.cache/pip', as in here , but it doesn't work.

I have also tried using various python/pip version.

Does anyone has any clue on how to make this work?

I've encountered similar problems with heroku previously

sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-3.0 seems to be the suggested way og installing PyGObject.

This solution is most likely to work, but if that's not helpful either, my best suggestion is to use Docker.

Create a heroku.yml file and a Dockerfile . This heroku.yml file can be used as an example.

If you use heroku CLI you can run heroku stack:set container to change your stack to docker containers.

Also I'd suggest letting heroku build the image using the specification in the heroku.yml file instead of pushing an image into the container registry.

I hope this is helpful.

(should be a comment) same issue:(, I keep getting this error:

ERROR: Failed building wheel for PyGObject

I originally had this issue with an app I was trying to deploy so I ended up making a dummy app to test it out, but nope, same results.

I'm not too sure myself how to work around this:(.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM