2017-06-21 83 views
0

我最近想通過cx_freeze使我的python腳本可執行。我試圖蟒蛇3.5和3.6同樣的錯誤......Python cx_freeze生成錯誤

由於錯誤我得到console.py module.run()在stratup.py線14和第26行的exec(代碼,男,字典)(均腳本屬於cx_freeze)。

這將是很好,如果有人會他們的工作setup.py和一些代碼,他們已經用來建立EXE沒有錯誤(任何代碼不值得我不想偷哈哈我只是想與我的代碼比較)

任何人知道如何解決它或我必須在我的Python腳本中做一些額外的導入?

回答

0

我setup.py版本

import sys 
from cx_Freeze import setup, Executable 

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

opts = { 'include_files' : ['Pixel Skull.png'] , 'includes' : ['re'] } 

setup(
name = 'Number generator' , 
version = '1.0' , 
description = 'Random number generator' , 
author = 'Silentstorm' , 
options = {'build_exe' : opts } , 
executables = [ Executable('Number generator.py' , base = base) ]) 

當您完成後,把在命令提示符下鍵入以下行:

python setup.py bdist_msi 

我知道你想要一個exe文件,但是這將產生一個MSI,當你運行MSI時,會創建一個exe文件。 希望它適合你。另外如果可能的話,我可以得到你的setup.py的副本嗎?