2017-06-04 4 views
1

Ich habe diesen Fehler seit langer Zeit bekommen, ich habe versucht, neu zu installieren und so. Cx_Freeze hat gut funktioniert, bevor ich versucht habe, ausführbare Dateien aus Pygame-Programmen zu machen. Hier ist der Fehler:cx_Freeze Dateifehler

File "setup.py", line 8, in <module> 
    executables=executables 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\dist.py", line 349, in setup 
    distutils.core.setup(**attrs) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\distutils\core.py", line 148, in setup 
    dist.run_commands() 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 955, in run_commands 
    self.run_command(cmd) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 974, in run_command 
    cmd_obj.run() 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\distutils\command\build.py", line 135, in run 
    self.run_command(cmd_name) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\distutils\cmd.py", line 313, in run_command 
    self.distribution.run_command(command) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 974, in run_command 
    cmd_obj.run() 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\dist.py", line 219, in run 
    freezer.Freeze() 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\freezer.py", line 621, in Freeze 
    self.finder = self._GetModuleFinder() 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\freezer.py", line 340, in _GetModuleFinder 
    finder.IncludePackage(name) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 655, in IncludePackage 
    self._ImportAllSubModules(module, deferredImports) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 279, in _ImportAllSubModules 
    deferredImports) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 403, in _InternalImportModule 
    parentModule, namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 416, in _LoadModule 
    namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 485, in _LoadPackage 
    self._LoadModule(name, fp, path, info, deferredImports, parent) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 474, in _LoadModule 
    self._ScanCode(module.code, module, deferredImports) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 564, in _ScanCode 
    module, relativeImportIndex) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 310, in _ImportModule 
    deferredImports, namespace = namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 403, in _InternalImportModule 
    parentModule, namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 474, in _LoadModule 
    self._ScanCode(module.code, module, deferredImports) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 564, in _ScanCode 
    module, relativeImportIndex) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 310, in _ImportModule 
    deferredImports, namespace = namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 403, in _InternalImportModule 
    parentModule, namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 416, in _LoadModule 
    namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 485, in _LoadPackage 
    self._LoadModule(name, fp, path, info, deferredImports, parent) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 474, in _LoadModule 
    self._ScanCode(module.code, module, deferredImports) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 564, in _ScanCode 
    module, relativeImportIndex) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 310, in _ImportModule 
    deferredImports, namespace = namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 403, in _InternalImportModule 
    parentModule, namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 474, in _LoadModule 
    self._ScanCode(module.code, module, deferredImports) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 569, in _ScanCode 
    fromList, deferredImports) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 210, in _EnsureFromList 
    self._ImportModule(subModuleName, deferredImports, caller) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 310, in _ImportModule 
    deferredImports, namespace = namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 403, in _InternalImportModule 
    parentModule, namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 416, in _LoadModule 
    namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 485, in _LoadPackage 
    self._LoadModule(name, fp, path, info, deferredImports, parent) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 474, in _LoadModule 
    self._ScanCode(module.code, module, deferredImports) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 588, in _ScanCode 
    topLevel = False) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 564, in _ScanCode 
    module, relativeImportIndex) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 310, in _ImportModule 
    deferredImports, namespace = namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 403, in _InternalImportModule 
    parentModule, namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 416, in _LoadModule 
    namespace) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 485, in _LoadPackage 
    self._LoadModule(name, fp, path, info, deferredImports, parent) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 463, in _LoadModule 
    self._RunHook("load", module.name, module) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\finder.py", line 536, in _RunHook 
    method(self, *args) 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\hooks.py", line 613, in load_tkinter 
    tclSourceDir = os.environ["TCL_LIBRARY"] 
    File "C:\Users\alpac\AppData\Local\Programs\Python\Python36-32\lib\os.py", line 669, in __getitem__ 
    raise KeyError(key) from None 
KeyError: 'TCL_LIBRARY' 

Hier ist das Setup:

import cx_Freeze 

    executables = [cx_Freeze.Executable("game.py")] 

    cx_Freeze.setup(
     name="Skillful Sky", 
     options={"build_exe": {"packages": ["pygame"], "include_files": ["gameairplane.png", "gameicon.png", "gamesong.wav"]}}, 
     executables=executables 
    ) 
+0

können Sie den Code der Python-Datei enthalten? –

Antwort

0

Ich denke, hat dies bereits beantwortet - https://stackoverflow.com/a/35706103/7046074. Bitte recherchieren Sie vor dem Posten und wenn Sie es versucht haben, erwähnen Sie es, damit die Leute Ihr Problem klar verstehen können.