question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when compiling a Gtk app (gi) with Nuitka 1.1.6 on Windows

See original GitHub issue

Hello,

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:closed
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kayhayencommented, Oct 26, 2022

Thanks for spotting that, I will include it in 1.1.7 which should be coming shortly.

0reactions
flozzcommented, Nov 6, 2022

Thank you very much for all your work on Nuitka! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuitka compilation error when building on windows
I have a python project I'd like to package up as a standalone executable. I have tried PyInstaller but with little luck. So...
Read more >
Nuitka - Bountysource
Hello,. I had an issue compiling a GTK application on Windows with the latest Nuitka version. It used to work with Nuitka 0.6.13...
Read more >
nuitka Changelog - pyup.io
Nuitka asserted against it failing, where some code handles it failing on non-Windows platforms. Fixed in 1.1.6 already. - Standalone: Added data files...
Read more >
Index of Portage & Programming - Gentoo Forums
Index of Portage & Programming. "Allow remote access to mySQL" Page:1 · "binary packages for different use flags?" Page:1 · "Question about LVM2...
Read more >
MSYS2 Packages
Package Version Description mingw‑w64‑x86_64‑3proxy 0.9.4‑1 3proxy ‑ tiny free proxy server (mingw‑w64) mingw‑w64‑x86_64‑4th 3.62.5‑1 A Forth Compiler (mingw‑w64) mingw‑w64‑x86_64‑SDL_gfx 2.0.26‑1 SDL Graphic Primitives (mingw‑w64)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found