Bonjour a tous,

je vais devoir developper pour un projet d'ici peu une application avec une interface graphique. Je comptais utiliser Gtk3 que je maitrise correctement en conjonction avec Python3.
Je chercherais donc, pour faciliter la distribution, a utiliser cx_freeze de maniere a produire un executable (pour windows notamment, mais tant qu'a faire, je le ferais aussi pour linux).

J'ai donc fait un petit test...
Malheureusement, je n'arrive pas a geler des scripts utilisant Gtk3. Jusqu'ici, j'ai compilé mon code en utilisant cette commande :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
cxfreeze 1.py --include-modules gi
Mais ça n'a rien donné...
A la "compilation" j'ai remarqué que le module Gtk (gi.repository.Gtk) semblait ne pas avoir été pris en compte :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Missing modules:
? _dummy_threading imported from dummy_threading
? _emx_link imported from os
? ce imported from os
? doctest imported from heapq
? getopt imported from base64, quopri
? gi.repository.Gtk imported from __main__
? nt imported from os
? ntpath imported from os
? org.python.core imported from copy
? os.path imported from os, pkgutil
? os2 imported from os
? os2emxpath imported from os
? subprocess imported from os
This is not necessarily a problem - the modules may not be needed on this platform.
Voila ce que j'obtiens a l'execution :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Traceback (most recent call last):
  File "/usr/lib/python3.3/site-packages/cx_Freeze/initscripts/Console3.py", line 27, in <module>
    exec(code, m.__dict__)
  File "1.py", line 5, in <module>
  File "/usr/lib/python3.3/importlib/_bootstrap.py", line 1565, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "/usr/lib/python3.3/importlib/_bootstrap.py", line 1512, in _find_and_load_unlocked
    _call_with_frames_removed(import_, parent)
  File "/usr/lib/python3.3/importlib/_bootstrap.py", line 313, in _call_with_frames_removed
    return f(*args, **kwds)
  File "/usr/lib/python3.3/importlib/_bootstrap.py", line 1565, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "/usr/lib/python3.3/importlib/_bootstrap.py", line 1532, in _find_and_load_unlocked
    loader.load_module(name)
  File "/usr/lib/python3.3/site-packages/gi/__init__.py", line 27, in <module>
    from ._gi import _API
  File "/usr/lib/python3.3/importlib/_bootstrap.py", line 1565, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "/usr/lib/python3.3/importlib/_bootstrap.py", line 1532, in _find_and_load_unlocked
    loader.load_module(name)
  File "ExtensionLoader_gi__gi.py", line 22, in <module>
  File "ExtensionLoader_gi__gi.py", line 14, in __bootstrap__
ImportError: could not import gobject (error was: SystemError('initialization of _gobject raised unreported exception',))
Quelqu'un a une idée pour resoudre cette erreur ?

Merci d'avance pour votre aide,