py2exe打包matplotlib和PyQt4「终于解决」

(35) 2023-03-27 08:04

Hi,大家好,我是编程小6,很荣幸遇见你,我把这些年在开发过程中遇到的问题或想法写出来,今天说一说py2exe打包matplotlib和PyQt4「终于解决」,希望能够帮助你!!!。
py2exe打包matplotlib和PyQt4「终于解决」_https://bianchenghao6.com/blog__第1张

代码转自py2exe打包问题,有小小的修改。

from distutils.core import setup
import py2exe,sys
import matplotlib

sys.path.append(r'D:\Program Files\
Microsoft Visual Studio 10.0\VC\redist\x86\Microsoft.VC100.CRT')
#this allows to run it with a simple double click.
sys.argv.append('py2exe')
setup(
    windows = [
    {
        "script": "main_window.py",
        #"icon_resources": [(1, "5.ICO")]
    }
    ],
options = {
"py2exe":
{
"includes": ["sip"],
"compressed":1,
"optimize":2,
"excludes":["Tkinter",],
"dll_excludes":["MSVCP90.dll"]}
},
data_files=matplotlib.get_py2exe_datafiles(),
)

亲测载入matplotlib、PyQt4、HTMLParser、urllib2、csv、sqlite3等模块都没有问题

上一篇

已是最后文章

下一篇

已是最新文章

发表回复