2017-05-31 64 views
1

我將python中的腳本轉換爲使用cx_Freeze的可執行文件,它在我的筆記本電腦(32位Windows 7)上安裝後可以正常工作。複製.msi文件並將其安裝到我的朋友的筆記本電腦(64位窗口10)後,它顯示此錯誤。python-cx_Freeze在64位操作系統上顯示錯誤

我認爲這個錯誤發生在我用'win32com.client'腳本的部分。 如何讓我的系統在其他平臺上工作?我是新來的這種東西,所以我希望任何人都能幫助我。

Error message

編輯:

這裏是我的setup.py腳本。

from cx_Freeze import setup, Executable 
import sys 
import os 

os.environ['TCL_LIBRARY'] = r'C:\Users\Admin\AppData\Local\Programs\Python\Python35-32\tcl\tcl8.6' 
os.environ['TK_LIBRARY'] = r'C:\Users\Admin\AppData\Local\Programs\Python\Python35-32\tcl\tk8.6' 

base = None 

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

if sys.platform == 'win64': 
    base = "Win64GUI" 

executables = [Executable("nafd.py", base=base,shortcutName="Nafd Encoding System",shortcutDir="ProgramMenuFolder", icon = "ntc96.ico")] 


setup(
    name = "Nafd32", 
    options = {"build_exe":{"packages": ["time","win32com.client","tkinter","openpyxl","functools","os","datetime","re","requests","io","math"],"include_files":["newlistofcity.txt","newlistofbrgy.txt","newlistofbrgycode.txt","ntc96.ico","tcl86t.dll", "tk86t.dll"]}}, 
    version = "2.1.5", 
    description = "Network and Facilities Division Encoding System", 
    executables = executables 
)  
+0

我嘗試在腳本中使用pyinstaller。它在我朋友的筆記本電腦上工作。我認爲cx_freeze沒有包含win32com.client中的.dll文件。 – Usagi

回答

0

通過包括從pyinstaller我setup.py創建dist文件夾中的所有.dll解決的問題。我不知道爲什麼cx_Freeze沒有複製win32com.client.dll文件,但是pyinstaller複製了所有這些文件。

相關問題