2011-04-09 5 views
4

안녕하세요, exe로 파이썬 스크립트를 컴파일하는 데 상대적으로 새로운입니다. 내 스크립트를 컴파일하는 데 cx_freeze를 사용하고 내장 된 exe를 실행하면 오류가 발생합니다. 구글을 많이 가지고 있지만 너무 확신하지는 마세요. 오류 :exe ​​error with cx_freeze

 
Cannot import traceback module. 
Exception: No module named re 
Original Exception: No module named re 

해결 방법에 대해 너무 자세하지 않습니다. 나는 아마도 re라는 모듈 사이에 충돌이 있다는 것을 읽었을 까? 파이썬으로? cx_freeze 모듈에 re라는 모듈이 있습니까? 런타임 작업 디렉토리의 실행 파일이있는 디렉토리가 아닌 경우

from cx_Freeze import setup, Executable 

includes = [] 
includefiles = ['remindersText.pkl'] 
eggsacutibull = Executable(
    script = "podlancer.py", 
    initScript = None, 
    base = 'Win32GUI', 
    targetName = "podlancer.exe", 
    compress = True, 
    copyDependentFiles = True, 
    appendScriptToExe = False, 
    appendScriptToLibrary = False, 
    icon = None 
    ) 

setup(
     name = "Podlancer", 
     version = "0.1", 
     author = 'jono', 
     description = "Podlancer UI script", 
     options = {"build_exe": {"includes":includes, "include_files": includefiles}}, 
     executables = [eggsacutibull] 
     ) 
+0

이것은 cx_Freeze의 버그입니다. 다음 릴리스에서 수정되어 다음 주에 출시 될 예정입니다. –

답변

6

+1

범례. =) 고마워! 실제로 무슨 일이 일어 났는지 알고 싶습니다. 나는 그것을 컴파일 할 때 어떤 이유로 든 다시 모듈을 포함 할 필요가있다. 따라서 그것을 포함시킨다 (이해가된다. 나는 생각하지 않았다.) ... 누군가는 그 모듈이 무엇을위한 것인지 압니까? – Mafster

+0

정규식 – Azimkhan

2

나 cx_Freeze이 발프 것

은 당신이 처음 수입 재 :

내 설치 파일은 같습니다.? 당신이 다른 순서로 그들을 할 때 어떻게됩니까?

0

회의 나를 위해 작동하지 않았다 includesre 퍼팅이 같은 문제를 위해 일

includes = ["re"] 

includes = [] 

을 변경하려고합니다. .py 파일을 다시 작성할 때 cx_Freeze.freezer.ConfigError이 생성되었습니다. 차라리 include_files에서이 컴파일 오류가 발생하지 않았다보다 packagesre을 넣으면

import sys 
from cx_Freeze import setup, Executable 

build_exe_options = {'include_files': ['re']} 

setup( name = "Foreground Window Montior", 
     version = "0.1", 
     description = "Query the foreground window.", 
     options = {'build_exe': build_exe_options}, 
     executables = [Executable("actWin_Query.py")]) 

.

import sys 
from cx_Freeze import setup, Executable 

build_exe_options = {"packages": ["re"]} 

setup( name = "Foreground Window Montior", 
     version = "0.1", 
     description = "Query the foreground window.", 
     options = {'build_exe': build_exe_options}, 
     executables = [Executable("actWin_Query.py")])