Erreur de création d'exe

a marqué ce sujet comme résolu.

Bonjour à tous,

J'ai voulu tester de transformer un de mes script python en .exe pour le diffuser à des collègues . Cependant j'ai des erreurs avec cx_freeze lors du build qui ne me parlent pas du tout :

  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
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
D:\Python\facebook>python.exe setup.py build
running build
running build_exe
creating directory build\exe.win32-3.4
copying C:\Python34\lib\site-packages\cx_Freeze\bases\Console.exe -> build\exe.w
in32-3.4\calcul-fb.exe
copying C:\Python34\python34.dll -> build\exe.win32-3.4\python34.dll
*** WARNING *** unable to create version resource
install pywin32 extensions first
writing zip file build\exe.win32-3.4\library.zip

  Name                      File
  ----                      ----
m BUILD_CONSTANTS
m __future__                C:\Python34\lib\__future__.py
m _ast
m _bootlocale
m _bz2                      C:\Python34\DLLs\_bz2.pyd
m _codecs
m _codecs_cn
m _codecs_hk
m _codecs_iso2022
m _codecs_jp
m _codecs_kr
m _codecs_tw
m _collections
m _collections_abc
m _csv
m _datetime
m _dummy_thread
m _functools
m _heapq
m _imp
m _io
m _locale
m _multibytecodec
m _opcode
m _operator
m _sre
m _stat
m _string
m _strptime
m _struct
m _thread
m _threading_local
m _warnings
m _weakref
m _weakrefset
m abc
m argparse
m ast                       C:\Python34\lib\ast.py
m atexit
m base64
m binascii
m builtins
m bz2
m calcul-fb__main__         calcul-fb.py
m calendar
m codecs
P collections
m collections.abc
m contextlib
m copy
m copyreg
m csv                       C:\Python34\lib\csv.py
m cx_Freeze__init__         C:\Python34\lib\site-packages\cx_Freeze\initscripts\
Console.py
m datetime
m dis                       C:\Python34\lib\dis.py
m dummy_threading
P encodings
m encodings.aliases
m encodings.ascii
m encodings.base64_codec
m encodings.big5
m encodings.big5hkscs
m encodings.bz2_codec
m encodings.charmap
m encodings.cp037
m encodings.cp1006
m encodings.cp1026
m encodings.cp1125
m encodings.cp1140
m encodings.cp1250
m encodings.cp1251
m encodings.cp1252
m encodings.cp1253
m encodings.cp1254
m encodings.cp1255
m encodings.cp1256
m encodings.cp1257
m encodings.cp1258
m encodings.cp273
m encodings.cp424
m encodings.cp437
m encodings.cp500
m encodings.cp65001
m encodings.cp720
m encodings.cp737
m encodings.cp775
m encodings.cp850
m encodings.cp852
m encodings.cp855
m encodings.cp856
m encodings.cp857
m encodings.cp858
m encodings.cp860
m encodings.cp861
m encodings.cp862
m encodings.cp863
m encodings.cp864
m encodings.cp865
m encodings.cp866
m encodings.cp869
m encodings.cp874
m encodings.cp875
m encodings.cp932
m encodings.cp949
m encodings.cp950
m encodings.euc_jis_2004
m encodings.euc_jisx0213
m encodings.euc_jp
m encodings.euc_kr
m encodings.gb18030
m encodings.gb2312
m encodings.gbk
m encodings.hex_codec
m encodings.hp_roman8
m encodings.hz
m encodings.idna
m encodings.iso2022_jp
m encodings.iso2022_jp_1
m encodings.iso2022_jp_2
m encodings.iso2022_jp_2004
m encodings.iso2022_jp_3
m encodings.iso2022_jp_ext
m encodings.iso2022_kr
m encodings.iso8859_1
m encodings.iso8859_10
m encodings.iso8859_11
m encodings.iso8859_13
m encodings.iso8859_14
m encodings.iso8859_15
m encodings.iso8859_16
m encodings.iso8859_2
m encodings.iso8859_3
m encodings.iso8859_4
m encodings.iso8859_5
m encodings.iso8859_6
m encodings.iso8859_7
m encodings.iso8859_8
m encodings.iso8859_9
m encodings.johab
m encodings.koi8_r
m encodings.koi8_u
m encodings.latin_1
m encodings.mac_arabic
m encodings.mac_centeuro
m encodings.mac_croatian
m encodings.mac_cyrillic
m encodings.mac_farsi
m encodings.mac_greek
m encodings.mac_iceland
m encodings.mac_latin2
m encodings.mac_roman
m encodings.mac_romanian
m encodings.mac_turkish
m encodings.mbcs
m encodings.palmos
m encodings.ptcp154
m encodings.punycode
m encodings.quopri_codec
m encodings.raw_unicode_escape
m encodings.rot_13
m encodings.shift_jis
m encodings.shift_jis_2004
m encodings.shift_jisx0213
m encodings.tis_620
m encodings.undefined
m encodings.unicode_escape
m encodings.unicode_internal
m encodings.utf_16
m encodings.utf_16_be
m encodings.utf_16_le
m encodings.utf_32
m encodings.utf_32_be
m encodings.utf_32_le
m encodings.utf_7
m encodings.utf_8
m encodings.utf_8_sig
m encodings.uu_codec
m encodings.zlib_codec
m errno
m functools
m gc
m genericpath
m gettext
P gi                        C:\Python34\lib\site-packages\gi\__init__.py
m gi._constants             C:\Python34\lib\site-packages\gi\_constants.py
m gi._gi                    C:\Python34\lib\site-packages\gi\_gi.pyd
m gi._propertyhelper        C:\Python34\lib\site-packages\gi\_propertyhelper.py
m gi._signalhelper          C:\Python34\lib\site-packages\gi\_signalhelper.py
m gi.docstring              C:\Python34\lib\site-packages\gi\docstring.py
m gi.importer               C:\Python34\lib\site-packages\gi\importer.py
m gi.module                 C:\Python34\lib\site-packages\gi\module.py
P gi.overrides              C:\Python34\lib\site-packages\gi\overrides\__init__.
py
P gi.repository             C:\Python34\lib\site-packages\gi\repository\__init__
.py
m gi.types                  C:\Python34\lib\site-packages\gi\types.py
m heapq
m imp                       C:\Python34\lib\imp.py
P importlib                 C:\Python34\lib\importlib\__init__.py
P importlib                 C:\Python34\lib\importlib\__init__.py
m importlib._bootstrap
m importlib._bootstrap      C:\Python34\lib\importlib\_bootstrap.py
m importlib.machinery       C:\Python34\lib\importlib\machinery.py
m importlib.util            C:\Python34\lib\importlib\util.py
m inspect                   C:\Python34\lib\inspect.py
m io
m itertools
m keyword
m linecache
m locale
m marshal
m math
m nt
m ntpath
m opcode                    C:\Python34\lib\opcode.py
m operator
m optparse
m os
m pkgutil                   C:\Python34\lib\pkgutil.py
m posixpath
m quopri
m re
m reprlib
m sre_compile
m sre_constants
m sre_parse
m stat
m string
m stringprep
m struct
m sys
m textwrap
m threading
m time
m token
m tokenize
m traceback
m types
m unicodedata               C:\Python34\DLLs\unicodedata.pyd
m warnings
m weakref
m zipimport
m zlib

Missing modules:
? _dummy_threading imported from dummy_threading
? ce imported from os
? doctest imported from heapq
? getopt imported from base64, quopri
? gi.repository.Gtk imported from calcul-fb__main__
? org.python.core imported from copy
? os.path imported from os, pkgutil
? posix imported from os
? pwd imported from posixpath
? subprocess imported from os
This is not necessarily a problem - the modules may not be needed on this platfo
rm.

C:\Python34\lib\site-packages\cx_Freeze\freezer.py:590: UserWarning: Duplicate n
ame: 'importlib/__init__.pyc'
  outFile.writestr(zinfo, data)
copying C:\Python34\DLLs\_bz2.pyd -> build\exe.win32-3.4\_bz2.pyd
copying C:\Python34\lib\site-packages\gi\_gi.pyd -> build\exe.win32-3.4\gi._gi.p
yd
copying C:\Python34\Lib\site-packages\gnome\libffi-6.dll -> build\exe.win32-3.4\
libffi-6.dll
copying C:\Python34\Lib\site-packages\gnome\libgirepository-1.0-1.dll -> build\e
xe.win32-3.4\libgirepository-1.0-1.dll
copying C:\Python34\Lib\site-packages\gnome\libgio-2.0-0.dll -> build\exe.win32-
3.4\libgio-2.0-0.dll
copying C:\Python34\Lib\site-packages\gnome\libintl-8.dll -> build\exe.win32-3.4
\libintl-8.dll
copying C:\Python34\Lib\site-packages\gnome\libwinpthread-1.dll -> build\exe.win
32-3.4\libwinpthread-1.dll
copying C:\Python34\Lib\site-packages\gnome\libglib-2.0-0.dll -> build\exe.win32
-3.4\libglib-2.0-0.dll
copying C:\Python34\Lib\site-packages\gnome\libgmodule-2.0-0.dll -> build\exe.wi
n32-3.4\libgmodule-2.0-0.dll
copying C:\Python34\Lib\site-packages\gnome\libzzz.dll -> build\exe.win32-3.4\li
bzzz.dll
copying C:\Python34\Lib\site-packages\gnome\libgobject-2.0-0.dll -> build\exe.wi
n32-3.4\libgobject-2.0-0.dll
copying C:\Python34\DLLs\unicodedata.pyd -> build\exe.win32-3.4\unicodedata.pyd

D:\Python\facebook>

D'où peut provenir mon soucis ?

Merci de votre aide ;)

J'ai installé pywin32 à la première tentative et pourtant ca change pas cet erreur oO et oui le dossier build est bien rempli mais le .exe génère une erreur alors que le script fonctionne nickel :

 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
D:\Python\facebook\build\exe.win32-3.4>calcul-fb
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27
, in <module>
    exec(code, m.__dict__)
  File "calcul-fb.py", line 4, in <module>
  File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 2237, in _find_a
nd_load
  File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 2226, in _find_a
nd_load_unlocked
  File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 1191, in _load_u
nlocked
  File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 1161, in _load_b
ackward_compatible
  File "C:\Python34\lib\site-packages\gi\__init__.py", line 42, in <module>
    from . import _gi
  File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 2284, in _handle
_fromlist
  File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 321, in _call_wi
th_frames_removed
  File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 2237, in _find_a
nd_load
  File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 2226, in _find_a
nd_load_unlocked
  File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 1191, in _load_u
nlocked
  File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 1161, in _load_b
ackward_compatible
  File "ExtensionLoader_gi__gi.py", line 22, in <module>
  File "ExtensionLoader_gi__gi.py", line 14, in __bootstrap__
SystemError: initialization of _gi raised unreported exception

D:\Python\facebook\build\exe.win32-3.4>
+0 -0
Connectez-vous pour pouvoir poster un message.
Connexion

Pas encore membre ?

Créez un compte en une minute pour profiter pleinement de toutes les fonctionnalités de Zeste de Savoir. Ici, tout est gratuit et sans publicité.
Créer un compte