python2.7+pyqt4程序打包遇到的问题,求解!谢谢
系统环境Win10,我用python2.7和pyqt4编写了个应用程序,在pycharm上调试后都能正常运行后,选择py2exe工具进行打包,按照网上的办法,打包文件内容和运行后结果如下,执行完后在dist文件夹exefctf运行时提示,没有chardet模块。实际上我已经导入了啊。
一、打包文件内容:
from distutils.core import setup
import py2exe
import sys
#this allows to run it with a simple double click.
sys.argv.append('py2exe')
py2exe_options = {
"includes": ["sip","re","os","xlrd","sys",“chardet","string","PyQt4"],
"dll_excludes": ["MSVCP90.dll",],
"compressed": 1,
"optimize": 2,
"ascii": 0,
"bundle_files": 1,
}
setup(
name = 'AFTNjieyi',
version = '1.0',
windows = ['ui_aftn.py','cs_aftn.py','myDict.py'],
zipfile = None,
options = {'py2exe': py2exe_options}
)
二、程序运行结果:
Traceback (most recent call last):
File "ui_aftn.py", line 10, in <module>
ImportError: No module named chardet