- dim. 15 juin 2014 17:55
#133186
Note:La compilation est ok, modification du poste pour continuer sur l'utilitaire.
Bonjour,
Un souci, pas moyen de réaliser une compilation même un simple print provoque les erreurs. J'ai exposé mon souci sur divers forum dont spécialisé en python et personne semble comprendre.
Toutes les installations sont réalisées par défaut (python 3.4, Pyside, EasyGui, pyQt, cx_freeze) tous dans le répertoire python34
Et tout fonctionne correctement avec IDLE
Merci
Messages d'erreurs :
C:\Python34python setup.py build
running build
running build_exe
Traceback (most recent call last):
File "setup.py", line 82, in module
executables = [cible_1]
File "C:\Python34\lib\site-packages\cx_Freeze\dist.py", line 362, in setup
distutils.core.setup(**attrs)
File "C:\Python34\lib\distutils\core.py", line 149, in setup
dist.run_commands()
File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\site-packages\cx_Freeze\dist.py", line 232, in run
freezer.Freeze()
File "C:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 605, in Freeze
self._FreezeExecutable(executable)
File "C:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 157, in _Freez
eExecutable
finder = self._GetModuleFinder(exe)
File "C:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 338, in _GetMo
duleFinder
argsSource.copyDependentFiles, compress = argsSource.compress)
File "C:\Python34\lib\site-packages\cx_Freeze\finder.py", line 160, in __init_
_
self._AddBaseModules()
File "C:\Python34\lib\site-packages\cx_Freeze\finder.py", line 189, in _AddBas
eModules
self.IncludePackage("encodings")
File "C:\Python34\lib\site-packages\cx_Freeze\finder.py", line 688, in Include
Package
self._ImportAllSubModules(module, deferredImports)
File "C:\Python34\lib\site-packages\cx_Freeze\finder.py", line 320, in _Import
AllSubModules
raise ImportError("No module named %r" % subModuleName)
ImportError: No module named 'encodings.iconvcodec'
C:\Python34
Mon setup :
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Python 3.4
import sys, os
from cx_Freeze import setup, Executable
#############################################################################
# preparation des options
# chemins de recherche des modules
path = sys.path
# options d'inclusion/exclusion des modules
includes = []
excludes = []
packages = []
# copier les fichiers et/ou repertoires et leur contenu:
includefiles = ['2014-06-02_192814.gif']
# pour que les bibliotheques de /usr/lib soient copiees aussi sous Linux
binpathincludes = []
if sys.platform == "linux2":
binpathincludes += ["/usr/lib"]
# construction du dictionnaire des options
options = {"path": path,
"includes": includes,
"excludes": excludes,
"packages": packages,
"include_files": includefiles,
"bin_path_includes": binpathincludes,
"create_shared_zip": False,
"include_in_shared_zip": False,
"compressed": False
}
# pour inclure sous Windows les dll system necessaires
if sys.platform == "win32":
options["include_msvcr"] = True
#############################################################################
# preparation des cibles
base = None
if sys.platform == "win32":
base = "Win32GUI"
#base = "Console"
icone = None
if sys.platform == "win32":
icone = "icone_guw.ico"
cible_1 = Executable(
script = "guw",
base = base,
compress = False,
copyDependentFiles = True,
appendScriptToExe = True,
appendScriptToLibrary = False,
icon = icone
)
#############################################################################
# creation du setup
setup(
name = "guw.py",
version = "1",
description = "guw",
author = "Vulcain",
options = {"build_exe": options},
executables = [cible_1]
)
Bonjour,
Un souci, pas moyen de réaliser une compilation même un simple print provoque les erreurs. J'ai exposé mon souci sur divers forum dont spécialisé en python et personne semble comprendre.
Toutes les installations sont réalisées par défaut (python 3.4, Pyside, EasyGui, pyQt, cx_freeze) tous dans le répertoire python34
Et tout fonctionne correctement avec IDLE
Merci
Messages d'erreurs :
C:\Python34python setup.py build
running build
running build_exe
Traceback (most recent call last):
File "setup.py", line 82, in module
executables = [cible_1]
File "C:\Python34\lib\site-packages\cx_Freeze\dist.py", line 362, in setup
distutils.core.setup(**attrs)
File "C:\Python34\lib\distutils\core.py", line 149, in setup
dist.run_commands()
File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\site-packages\cx_Freeze\dist.py", line 232, in run
freezer.Freeze()
File "C:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 605, in Freeze
self._FreezeExecutable(executable)
File "C:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 157, in _Freez
eExecutable
finder = self._GetModuleFinder(exe)
File "C:\Python34\lib\site-packages\cx_Freeze\freezer.py", line 338, in _GetMo
duleFinder
argsSource.copyDependentFiles, compress = argsSource.compress)
File "C:\Python34\lib\site-packages\cx_Freeze\finder.py", line 160, in __init_
_
self._AddBaseModules()
File "C:\Python34\lib\site-packages\cx_Freeze\finder.py", line 189, in _AddBas
eModules
self.IncludePackage("encodings")
File "C:\Python34\lib\site-packages\cx_Freeze\finder.py", line 688, in Include
Package
self._ImportAllSubModules(module, deferredImports)
File "C:\Python34\lib\site-packages\cx_Freeze\finder.py", line 320, in _Import
AllSubModules
raise ImportError("No module named %r" % subModuleName)
ImportError: No module named 'encodings.iconvcodec'
C:\Python34
Mon setup :
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Python 3.4
import sys, os
from cx_Freeze import setup, Executable
#############################################################################
# preparation des options
# chemins de recherche des modules
path = sys.path
# options d'inclusion/exclusion des modules
includes = []
excludes = []
packages = []
# copier les fichiers et/ou repertoires et leur contenu:
includefiles = ['2014-06-02_192814.gif']
# pour que les bibliotheques de /usr/lib soient copiees aussi sous Linux
binpathincludes = []
if sys.platform == "linux2":
binpathincludes += ["/usr/lib"]
# construction du dictionnaire des options
options = {"path": path,
"includes": includes,
"excludes": excludes,
"packages": packages,
"include_files": includefiles,
"bin_path_includes": binpathincludes,
"create_shared_zip": False,
"include_in_shared_zip": False,
"compressed": False
}
# pour inclure sous Windows les dll system necessaires
if sys.platform == "win32":
options["include_msvcr"] = True
#############################################################################
# preparation des cibles
base = None
if sys.platform == "win32":
base = "Win32GUI"
#base = "Console"
icone = None
if sys.platform == "win32":
icone = "icone_guw.ico"
cible_1 = Executable(
script = "guw",
base = base,
compress = False,
copyDependentFiles = True,
appendScriptToExe = True,
appendScriptToLibrary = False,
icon = icone
)
#############################################################################
# creation du setup
setup(
name = "guw.py",
version = "1",
description = "guw",
author = "Vulcain",
options = {"build_exe": options},
executables = [cible_1]
)
Le pessimiste se plaint du vent, l'optimiste espère qu'il va changer, le réaliste ajuste ses voiles.William Arthur Ward