我收到错误:
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文件工作。 那么现在,谁可以帮助我,并告诉我是谁修理过它?
P.S。
我阅读了cx-freeze文档,
http://cx-freeze.readthedocs.org/en/latest/distutils.html
但这对我没有帮助。请帮忙? :)