実行可能ファイルを作成するために gui2exe を試すことにしましたが、PyInstaller、Py2exe、または cxFreeze のいずれでも動作しません。起動しない実行可能ファイルを作成します(実行すると、読み込みが開始され、読み込みが停止しますが、タスクマネージャーのプロセスにはありません)。
コンパイルされたプロジェクトをテストするように gui2exe が提案し、[はい] をクリックすると、次のエラーが表示されます。
バッチ ファイルまたは cmd を介してコンパイルすると、そのようなことは起こりません。
gui2exeの使用に関するヘルプ、ガイド、マニュアル、ドキュメントをお願いします!
- Windows 7 32ビットで実行しています
- パイソン 2.7
- GUI2exe-0.5.1
- pyinstaller-1.5.1、py2exe-0.6.9、cx_freeze-4.2.3 がインストールされています
更新: これが私が使用しているテスト コードです: ファイル Tk_tester.py (これがメイン)
# -*- coding: mbcs -*-
from Tkinter import *
import ttk
from ScrolledWidgets import ScrolledText
root = Tk()
root.title('Gui2exe tester application')
txt = ScrolledText(root)
txt.pack(side='top', fill='both', expand=1)
txt.Text['font'] = ('Tahoma', 10)
b = ttk.Button(root, text='Quit', command=root.quit)
b.pack(side='bottom', anchor='e')
root.mainloop()
およびファイル ScrolledWidgets.py
# -*- coding: mbcs -*-
from Tkinter import *
import ttk
class ScrolledText(ttk.Frame):
def __init__(self, master, scrolls = 'v'):
ttk.Frame.__init__(self, master)
self['relief'] = 'sunken'
self['borderwidth'] = 1
self.rowconfigure(0, weight = 1)
self.columnconfigure(0, weight = 1)
self.__scroll = scrolls
self.Text = Text(self, relief = 'flat', borderwidth = 0)
self.Text.grid(column = 0, row = 0, sticky = 'news')
if self.__scroll == 'v':
yscroll = ttk.Scrollbar(self, orient = 'vertical')
yscroll.grid(column = 1, row = 0, sticky = 'ns')
self.Text['yscrollcommand'] = yscroll.set
yscroll['command'] = self.Text.yview
elif self.__scroll == 'h':
xscroll = ttk.Scrollbar(self, orient = 'horizontal')
xscroll.grid(column = 0, row = 1, sticky = 'ew')
self.Text['xscrollcommand'] = xscroll.set
xscroll['command'] = self.Text.xview
elif self.__scroll == 'both':
yscroll = ttk.Scrollbar(self, orient = 'vertical')
yscroll.grid(column = 1, row = 0, sticky = 'ns')
self.Text['yscrollcommand'] = yscroll.set
yscroll['command'] = self.Text.yview
xscroll = ttk.Scrollbar(self, orient = 'horizontal')
xscroll.grid(column = 0, row = 1, sticky = 'ew')
self.Text['xscrollcommand'] = xscroll.set
xscroll['command'] = self.Text.xview
これは正常にコンパイルされます。しかし、結果のexeを実行すると、「ImportError: No module named carchive」が表示されます。
コンソールのみのアプリで試してみましたが、問題なく動作します。