2014-01-19 3 views
1

파일 (snake.py)을 exe로 컴파일하면 출력 파일 (exe 파일)이 작동하지 않습니다. 내가 컴파일하는 동안 이런 오류의 결과로 될 수있다 생각 :exe ​​파일이 제대로 작동하지 않습니다 (아무 일도 발생하지 않습니다)

missing modules: 
? _frozen_importlib imported from importlib 

enter image description here

어떤 아이디어?

import sys 
from cx_Freeze import setup, Executable 

base = None 
if sys.platform == "win32": 
     base = "Win32GUI" 

setup(
    name = "simple_PyQt4", 
    version = "0.1", 
    description = "Sample cx_Freeze PyQt4 script", 
    options = {"build_exe" : {"includes" : "atexit" }}, 
    executables = [Executable("hello_qt.py", base = base)]) 
+0

exe를 "컴파일"하기 위해 사용하는 도구는 무엇입니까? – Fenikso

+0

exe는 어떤 오류가 있습니까? 그것이 "작동하지 않는"것이 정확히 무엇입니까? – Fenikso

+0

exe를 빌드하기위한 설정은 무엇입니까? "hello_world.py"를 성공적으로 빌드 할 수 있습니까? "hello_qt.py"와 같은 것을 성공적으로 만들 수 있습니까? – Fenikso

답변

1

나는 PySide을 사용하지만 PyQt와 거의 동일해야합니다.

c:\Python33\Scripts\cxfreeze.bat hello_pyside.py --target-dir=Bin/pyside --base-name=Win32GUI --target-name=hello_pyside.exe --include-modules=re --exclude-modules=Tkinter 

내가 들어있는 디렉토리 얻을 :

_bz2.pyd 
hello_pyside.exe 
PySide.QtCore.pyd 
PySide.QtGui.pyd 
pyside-python3.3.dll 
python33.dll 
QtCore4.dll 
QtGui4.dll 
shiboken-python3.3.dll 
unicodedata.pyd 

것은이 잘 작동해야을 나는이 스크립트 cx_freeze 설치 전화

import sys 
from PySide.QtCore import * 
from PySide.QtGui import * 

class Window(QWidget): 
    def __init__(self, *args, **kwargs): 
     QWidget.__init__(self, *args, **kwargs) 

     self.button = QPushButton("Test", self) 
     self.button.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) 

     self.layout = QHBoxLayout() 
     self.layout.setContentsMargins(5, 5, 5, 5) 
     self.layout.addWidget(self.button) 

     self.setLayout(self.layout) 
     self.show() 

app = QApplication(sys.argv) 
win = Window() 
sys.exit(app.exec_()) 

:

이 코드 hello_pyside.py이 .

관련 문제