No success on freezing with nuitka (and how to freeze ?)
All-In-One PyGI/PyGObject for Windows Installer
Status: Abandoned
Brought to you by:
tumagonx
Hello !
I try to freeze my app which uses pygi on windows with nuitka and it doesn't work (no problem on linux). You can look at this on http://bugs.nuitka.net/issue242. I write this message because I don't know where is the problem (dependency walker on a really simple test case is on the latest link).
Is there a bug in pygi ? Is it my mistake ? (Optional question : how can I freeze an app that uses pygi on windows ? I didn't succeed with cx_freeze, pyinstaller... :-( ). I use python3.4 32bit.
Thanks in advance !
Sorry, Have you tried rev22 (the switch to os.environ instead of putenv) may help packaging.
BTW when thing like "import error" happen during packaging, the first thing you should try is adding gnome subdirectory into PATH environment
Since we are talk about broad possibility of packaging it would better to put this at discussion, so other guys with different bundler may share their experience.
Ok. I will try your suggestions in the next minutes. About discussion on freezing, I posted a message on monday in the discussion section but it is still on moderation stage (awaiting moderation) ; see https://sourceforge.net/p/pygobjectwin32/discussion/general/thread/b8d6781c/ ;-)
I installed rev22. Programs work with python interpreter, but no success after freezing. It fails like on the example I put on http://bugs.nuitka.net/issue242.
Here is my PATH :
C:\Python34\;C:\Python34\Scripts;C:\Python34\Lib\site-packages\;C:\Python34\Lib\
site-packages\gnome;C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\
javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\Syst
em32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Git\cmd
Here are all messages :
E:\Chemin\Test.dist>Test.exe
Traceback (most recent call last):
File "<frozen importlib._bootstrap="">", line 2158, in _find_spec
AttributeError: 'DynamicImporter' object has no attribute 'find_spec'</frozen>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\Chemin\Test.dist\Test.py",
line 1, in <module>
File "E:\Chemin\Test.dist\gi\importer.py", line 53, in find_module
'introspection typelib not found' % namespace)
ImportError: cannot import name Gtk, introspection typelib not found</module>
E:\Bla\DebugTest\Test.dist>echo %PATH%
C:\Python34\;C:\Python34\Scripts;C:\Python34\Lib\site-packages\;C:\Python34\Lib\
site-packages\gnome;C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\
javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\Syst
em32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Git\cmd
So now, I don't know what to try...
Thanks, I will try nuitka myself and maybe cx_freeze (I think lazka of Quodlibet succesfully use it)
Ok. If you have success with it, thanks in advance to share your solution ;-).
(nothing to do here but sourceforge is strange for me : it marked 2 messages from me with "Post awaiting moderation" and they are still in this state... I can't even see the writings in these messages... ???? + I don't receive know notifications for new messages... Mysteries, mysteries...).
I could get past typelib stuff, You need to copy gnome folder's content into yourapp.dist folder
But I get segfault... GDB show :
Oh if I don't use --portable it run well. hmm
Uugh it's hard debug...
Well basically all you need is to copy gnome's content alongside the produced exe (assuming wtihout --portable option)
Gloups, it's the same for me without --portable option... But I need this option because I want to run my program on windows targets without all python stuff :-(. That's why I need to freeze my app.
I'm closing this as it's irrelevant to pygi or rather it's like "does niutka has specific pygi support like pyqt?" not yet.
So it is niutka's problem not pygi. As a matter of fact run via interpreter mode is OK.
I updated my answer here https://sourceforge.net/p/pygobjectwin32/discussion/general/thread/b8d6781c/ You might want to link that page to your niutka bugreport.
Regarding the segfault, it because niutka's default -O3 optimization level seems make my gcc produce unstable binary, lowering it (-O2/-Os/-O1) will make it works.
Last edit: tumagonx 2015-09-10
I linked your pages on nuitka bugreport. Thanks !!