###実現したいこと
py2exe で、win32uiを用いても実行できるexeファイルを作ることです。
独学で、プログラムミングをしていますので、詳しい解説を期待しております。
また、今回初めての質問なので、誤った書き方などがありましたら指摘してほしいです。
よろしくお願いします
###補足情報(言語/FW/ツール等のバージョンなど)
python 2.7
py2exe バージョン 0.6.9
###発生している問題・エラーメッセージ
python
1エラーメッセージ 2Traceback (most recent call last): 3 File "作成プログラム名", line 4, in <module> 4 File "zipextimporter.pyo", line 98, in load_module 5ImportError: MemoryLoadLibrary failed loading win32ui.pyd 6 7
行ったこと
"http://www.py2exe.org/index.cgi/Tutorial#Step52"
"http://surgo.jp/2010/08/pyqt-py2exe.html"
などを参考にし、setupファイルに追加しました。
また、C++ 2008 Redistributable Package (x86) が必要らしく、ダウンロードしたのですがどのように用いればよいのかわらず、詳しく記載されているサイトが今のところありませんでした。
今回作成しているプログラムは、以下のメソッドを用いています。
win32ui.CreateDCFromHandle(dc)
python
1# setupfile 2 3# 以下を追加 4 5WIN32UI_DIR = r"C:\----\python\Lib\site-packages\pythonwin" 6 7mfcfiles = [os.path.join(WIN32UI_DIR, i) for i in [ 8 "mfc90.dll", 9 "mfc90u.dll", 10 "mfcm90.dll", 11 "mfcm90u.dll", 12 "Microsoft.VC90.MFC.manifest"]] 13 14# ここからわからないです 15data_files = [ 16 ("Microsoft.VC90.MFC", mfcfiles), 17] 18 19setup( 20 data_files = data_files, 21
今まで用いていた setupfile
# -*- coding: utf-8 -*- import os import py2exe from distutils.core import setup SCR_NAME = "プログラム名 " origIsSystemDLL = py2exe.build_exe.isSystemDLL def isSystemDLL(pathname): if os.path.basename(pathname).lower() in ("libfreetype-6.dll", "libogg-0.dll", "sdl_ttf.dll"): return 0 return origIsSystemDLL(pathname) py2exe.build_exe.isSystemDLL = isSystemDLL # ここに先ほどのを追加 option = { "compressed" : 1 , "optimize" : 2 , "bundle_files" : 1 } setup( # ここに先ほどのを追加 options = {"py2exe" : option}, windows = [{"script" : SCR_NAME}], zipfile = None )
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/10/19 05:19
2016/10/19 07:21
2016/10/19 07:51
2016/10/19 08:05