2013-06-12 61 views
0

我在嘗試將wxpython應用程序編譯成exe文件時遇到了很多麻煩。 py2exe不斷給我錯誤,並不會將我的代碼編譯爲exe。以下是我運行簡單的setup.py腳本時發生的情況。我在Windows 64位和Python 2.7和使用py2exe 64位。 (捆綁在64位py2exe中不起作用,不確定是否會出現問題)我相信自從我安裝了Microsoft Visual Studio以來,我已經安裝了所有正確的DLL。任何幫助,將不勝感激。wxpython和py2exe不起作用

*** searching for required modules *** 
*** parsing results *** 
creating python loader for extension 'P4API' (C:\Python27\lib\site-packages\P4AP 
I.pyd -> P4API.pyd) 
creating python loader for extension 'wx._misc_' (C:\Python27\lib\site-packages\ 
wx-2.8-msw-unicode\wx\_misc_.pyd -> wx._misc_.pyd) 
creating python loader for extension 'select' (C:\Python27\DLLs\select.pyd -> se 
lect.pyd) 
creating python loader for extension 'unicodedata' (C:\Python27\DLLs\unicodedata 
.pyd -> unicodedata.pyd) 
creating python loader for extension 'wx._windows_' (C:\Python27\lib\site-packag 
es\wx-2.8-msw-unicode\wx\_windows_.pyd -> wx._windows_.pyd) 
creating python loader for extension 'wx._core_' (C:\Python27\lib\site-packages\ 
wx-2.8-msw-unicode\wx\_core_.pyd -> wx._core_.pyd) 
creating python loader for extension 'wx._gdi_' (C:\Python27\lib\site-packages\w 
x-2.8-msw-unicode\wx\_gdi_.pyd -> wx._gdi_.pyd) 
creating python loader for extension 'wx._controls_' (C:\Python27\lib\site-packa 
ges\wx-2.8-msw-unicode\wx\_controls_.pyd -> wx._controls_.pyd) 
creating python loader for extension 'bz2' (C:\Python27\DLLs\bz2.pyd -> bz2.pyd) 

*** finding dlls needed *** 
Traceback (most recent call last): 
    File "setup.py", line 4, in <module> 
    setup(windows=['PerforceApp.py']) 
    File "C:\Python27\lib\distutils\core.py", line 152, in setup 
    dist.run_commands() 
    File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands 
    self.run_command(cmd) 
    File "C:\Python27\lib\distutils\dist.py", line 972, in run_command 
    cmd_obj.run() 
    File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 243, in run 
    self._run() 
    File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 305, in _run 
    dlls = self.find_dlls(extensions) 
    File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 389, in find_dl 
ls 
    self.dll_excludes) 
    File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 1064, in find_d 
ependend_dlls 
    bin_depends(loadpath, images + [sys.executable], excludes_use) 
    File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 1441, in bin_de 
pends 
    if isSystemDLL(dll): 
    File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 1498, in isSyst 
emDLL 
    raise Exception, "Seems not to be an exe-file" 
Exception: Seems not to be an exe-file 

回答

1

我有一種被「MSVCP90.dll」文件引起了同樣的問題,所以我說這個指令到我的setup.py,現在,它就像一個魅力!

dll_excludes = ['MSVCP90.dll']