Error when compiling a Gtk app (gi) with Nuitka 1.1.6 on Windows
See original GitHub issueHello,
I had an issue compiling a GTK application on Windows with the latest Nuitka version. It used to work with Nuitka 0.6.13 and an older GTK3 version¹ but I am trying to upgrade the stack (GTK3 version, Nuitka,…).
I use gvsbuild 2022.04.1 to build GTK3. Nuitka (and Python / OS /…) versions are:
$ python -m nuitka --version
1.1.6
Commercial: None
Python: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
Flavor: Unknown
Executable: C:\Users\vm0\Desktop\yoga-image-optimizer\build\__env__\Scripts\python.exe
OS: Windows
Arch: x86_64
WindowsRelease: 10
I installed Python using the official installer form python.org and Nuitka was installed in a virtualenv using pip: pip install nuitka==1.1.6
Here is the list of all dependencies I have in the venv dedicated to the build:
$ python -m pip freeze
argcomplete==1.12.3
cffi==1.15.1
colorama==0.4.5
colorlog==4.8.0
distlib==0.3.6
filelock==3.8.0
imagequant==1.0.3
mozjpeg-lossless-optimization==1.1.1
nox==2020.12.31
Nuitka==1.1.6
Pillow==9.2.0
platformdirs==2.5.2
py==1.11.0
pycairo==1.21.0
pycparser==2.21
PyGObject==3.42.2
pyguetzli==1.0.11
Unidecode==1.3.6
virtualenv==20.16.5
yoga==1.2.1
yoga-image-optimizer @ file:///C:/Users/vm0/Desktop/yoga-image-optimizer
zopflipy==1.7
Here is the output of the build:
Nuitka-Options:INFO: Used command line options: --follow-imports --assume-yes-for-downloads --include-package=PIL --include-package-data=yoga_image_optimizer --plugin-enable=multiprocessing --plugin-enable=gi --windows-disable-console --windows-icon-from-ico=winbuild\icon.ico --standalone winbuild\yoga-image-optimizer.py
Nuitka-Options:INFO: Following all imports is the default for standalone mode and need not be specified.
Nuitka:WARNING: Using very slow fallback for ordered sets, please install 'orderedset' PyPI package for best Python
Nuitka:WARNING: compile time performance.
Nuitka-Plugins:WARNING: gi: Plugin is defined as always enabled.
Nuitka-Plugins:WARNING: multiprocessing: Plugin is defined as always enabled.
Nuitka:INFO: Starting Python compilation with Nuitka '1.1.6' on Python '3.9' commercial grade 'not installed'.
Nuitka-Plugins:INFO: gi: Injecting pre-module load code for module 'gi':
Nuitka-Plugins:INFO: gi: Set typelib search path
Nuitka-Plugins:INFO: multiprocessing: Injecting pre-module load code for module 'multiprocessing':
Nuitka-Plugins:INFO: multiprocessing: Monkey patching "multiprocessing" load environment.
Nuitka-Plugins:INFO: multiprocessing: Injecting post-module load code for module 'multiprocessing':
Nuitka-Plugins:INFO: multiprocessing: Monkey patching "multiprocessing" for compiled methods.
Traceback (most recent call last):
File "C:\Users\vm0\Desktop\yoga-image-optimizer\build\__env__\lib\site-packages\nuitka\__main__.py", line 138, in <module>
main()
File "C:\Users\vm0\Desktop\yoga-image-optimizer\build\__env__\lib\site-packages\nuitka\__main__.py", line 124, in main
MainControl.main()
File "C:\Users\vm0\Desktop\yoga-image-optimizer\build\__env__\lib\site-packages\nuitka\MainControl.py", line 928, in main
addIncludedDataFilesFromPackageOptions()
File "C:\Users\vm0\Desktop\yoga-image-optimizer\build\__env__\lib\site-packages\nuitka\freezer\IncludedDataFiles.py", line 327, in addIncludedDataFilesFromPackageOptions
for included_datafile in Plugins.considerDataFiles(module=module):
File "C:\Users\vm0\Desktop\yoga-image-optimizer\build\__env__\lib\site-packages\nuitka\plugins\Plugins.py", line 563, in considerDataFiles
for value in plugin.considerDataFiles(module):
File "C:\Users\vm0\Desktop\yoga-image-optimizer\build\__env__\lib\site-packages\nuitka\plugins\standard\GiPlugin.py", line 63, in considerDataFiles
gi_repository_path = os.path.dirname(path.introspection_module)
AttributeError: 'NoneType' object has no attribute 'introspection_module'
I can reproduce the issue with the following minimal example file:
from gi.repository import Gtk
compiled with the following options:
$ python -m nuitka --standalone --plugin-enable=gi example.py
¹ It used to work with Nuitka 0.6.13 without the --plugin-enable=gi
option (I imported manually the hidden imports of gi overrides)
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
Thanks for spotting that, I will include it in 1.1.7 which should be coming shortly.
Thank you very much for all your work on Nuitka! 😃