Bonjour à tous,

Je suis bien embarrassé. Je souhaiterais déployer mon application à l'aide de cx_freeze, mais quand je test le build réalisé, sur un debian fraîche, cela ne fonctionne pas.
J'ai donc essayé avec les exemples de cx_freeze (https://bitbucket.org/anthony_tuinin...er/?at=default), mais malheureusement (ou pas), j’obtiens le même résultat.

SimpleTkApp.py
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
try:
    from tkinter import Tk, Label, Button, BOTTOM
except ImportError:
    from Tkinter import Tk, Label, Button, BOTTOM
 
root = Tk()
root.title('Button')
Label(text='I am a button').pack(pady=15)
Button(text='Button').pack(side=BOTTOM)
root.mainloop()
setup.py
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
24
25
26
27
28
29
# -*- coding: utf-8 -*-
 
# A simple setup script to create an executable using Tkinter. This also
# demonstrates the method for creating a Windows executable that does not have
# an associated console.
#
# SimpleTkApp.py is a very simple type of Tkinter application
#
# Run the build process by running the command 'python setup.py build'
#
# If everything works well you should find a subdirectory in the build
# subdirectory that contains the files needed to run the application
 
import sys
from cx_Freeze import setup, Executable
 
base = None
if sys.platform == 'win32':
    base = 'Win32GUI'
 
executables = [
    Executable('SimpleTkApp.py', base=base)
]
 
setup(name='simple_Tkinter',
      version='0.1',
      description='Sample cx_Freeze Tkinter script',
      executables=executables
      )
Je "compile" avec la commande : Si j’exécute le fichier généré sur mon poste de développement (LMDE 2), cela fonction parfaitement.
En revanche, quand j’exécute sur ma VM de test (Debian 8.x), j’obtiens l’erreur suivante :
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Traceback (most recent call last):
  File "/usr/lib/python3.4/tkinter/__init__.py", line 39, in <module>
    import _tkinter
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 2237, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 2226, in _find_and_load_unlocked
    module = _SpecMethods(spec)._load_unlocked()
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 1191, in _load_unlocked
    return self._load_backward_compatible()
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 1161, in _load_backward_compatible
    spec.loader.load_module(spec.name)
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 539, in _check_name_wrapper
    return method(self, name, *args, **kwargs)
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 1715, in load_module
    fullname, self.path)
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 321, in _call_with_frames_removed
    return f(*args, **kwds)
ImportError: libBLT.2.5.so.8.6: cannot open shared object file: No such file or directory
 
During handling of the above exception, another exception occurred:
 
Traceback (most recent call last):
  File "SimpleTkApp.py", line 5, in <module>
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 2237, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 2226, in _find_and_load_unlocked
    module = _SpecMethods(spec)._load_unlocked()
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 1191, in _load_unlocked
    return self._load_backward_compatible()
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 1161, in _load_backward_compatible
    spec.loader.load_module(spec.name)
  File "/usr/lib/python3.4/tkinter/__init__.py", line 41, in <module>
    raise ImportError(str(msg) + ', please install the python3-tk package')
ImportError: libBLT.2.5.so.8.6: cannot open shared object file: No such file or directory, please install the python3-tk package
 
During handling of the above exception, another exception occurred:
 
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/cx_Freeze-4.3.4-py3.4-linux-x86_64.egg/cx_Freeze/initscripts/Console.py", line 27, in <module>
  File "SimpleTkApp.py", line 7, in <module>
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 2237, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 2224, in _find_and_load_unlocked
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'Tkinter'
J'ai essayer des imports dans tous les sens, rien ne fonctionne. Une idée ?