Hi. I’m trying to create an executable for a Python program that uses Rsvg from the PyGObject library. Since the program is built for Windows, I have to work on it from Windows, meaning I have to use MSYS2 to create the virtual environment and manage dependencies and such.
I can run the program without issue if I just run it from PyCharm using the venv, but if I try to create an executable using PyInstaller, it fails whenever it has to import Rsvg with the error, “ValueError: Namespace Rsvg not available
.” I know PyGObject is getting included in the dependency because the program also relies on GTK3, which the executable can run without issue. It only fails when it gets to Rsvg.
In MSYS2, I have the packages “mingw-w64-ucrt-x86_64-librsvg
” and "mingw-w64-x86_64-librsvg
" installed. Do I need to add something to the build command to expose it to Rsvg? My current command is “pyinstaller app.py --icon img/icon.ico --name app_x86_64 --noconfirm
.” I’ve tried adding “--collect-all gi
” and “--hidden-import=gi.repository.Rsvg
”.
Googling is to no avail. Anything that has a similar error only has solutions for Linux, or doesn’t have a solution period.