方法二:
只需要在你要編譯的相應的程序文件中我的文件test.py加放如下import
要注意大小寫哈___
import smtplib,email,sys
from email.mime.text import MIMEText
from email.Message import Message
import email.Utils
import email.generator
import email.base64MIME
import email.iterators
import email.message
相應用到py2exe setup.py文件中,相關代碼如下:
from distutils.core import setup
import py2exe
setup(
console=[server.py'],
options={
"py2exe":{
'bundle_files': 1,
"unbuffered": True,
"optimize": 2,
"includes": ["email"]
}
}
)
2、ImportError: MemoryLoadLibrary failed loading win32ap
setup.py中添加如下代碼: setup的 option 選項中加入 "dll_excludes": [ "mswsock.dll","powrprof.dll" ]即可,
原因:py2exe mistakenly added powrprof.dll
and mswsock.dll
to the package. Windows XP contains its own copiesof these files though。
setup(
options = {'py2exe':
{'bundle_files': 1,
"dll_excludes": [ "mswsock.dll","powrprof.dll" ]
}},
console = [test.py'],
zipfile = None,
)
參考文獻:
http://www.alarmchang.com/wiki/index.php?title=Python&diff=prev&oldid=618
http://stackoverflow.com/questions/1979486/py2exe-win32api-pyc-importerror-dll-load-failed
http://hi.baidu.com/jetqu2003/blog/item/39770003abb766713812bb4e.html
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com