エラーが発生します:
Traceback (most recent call last):
File
"C:\Python33'lib\site-packages\cx_Freeze\initscripts\Console3.py",
line 27, in<module>
exec(code, m._dict))
File "smtpMail.py", line 30, in <module>
File "C:\Python33\lib\site-packages\VideoCapture\_init_.py",line
62, in_init_
os.path.join(_path_[0], 'helvetica-10.pil'))
File "C:\Python33\lib\site-packages\PIL\ImageFont.py", line 273, in
load_path
raise IOError(cannot find font file)
OSError: cannot find font file
画像エラー、ファイル再生時: http://s14.postimg.org/4pek1fwld/cx_Freeze.jpg
私のプログラムはモジュールの数に基づいています。私のメインファイル「smtpMail.py」では、私のモジュールは次のとおりです。
import smtplib, platform, os, datetime
import socket
from VideoCapture import Device
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from win32com.client import GetObject
ビルド cx_Freeze の setup.py ファイルの間違いだと思います。必要なのは、setup.py ファイルを正しく編集する方法を知ることです。
import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]}
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup( name = "smtpMail",
version = "0.1",
description = "My GUI application!",
options = {"build_exe": build_exe_options},
executables = [Executable("smtpMail.py", base=base)])
誰が私を助けてくれますか? :)
更新中:
問題は「VideoCapture」モジュールにあると思います。次のようにファイルを編集します。
import sys
import smtplib, platform, os, datetime
import socket
from VideoCapture import Device
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from win32com.client import GetObject
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["smtplib","platform","os","datetime","socket","VideoCapture","PIL"], "excludes": ["tkinter"]}
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup( name = "smtpMail",
version = "0.1",
description = "My GUI application!",
options = {"build_exe": build_exe_options},
executables = [Executable("smtpMail.py", base=base)])
そして、それは機能しません-同じエラーを再度作成しました。そのため、stmpMail.py 内の「VideoCapture」モジュールに関連するすべてをコメントとしてマークします。
そしてワラ!! exeファイルが機能します。では、誰が私を助けて、誰がそれを直したのか教えてくれますか?
PS
cx-freeze のドキュメントを読みましたが、
http://cx-freeze.readthedocs.org/en/latest/distutils.html
しかし、それはまだ私を助けません。助けてください?:)