如何为PyInstaller包含Python模块?
在我第一次尝试把我的Python代码打包成.exe文件时,遇到了使用scipy.weave
模块时的一些问题。当我查看我的warnproject.txt文件时,发现里面有1324行警告(下面有几行示例)
W: no module named numpy.negative (top-level import by scipy.weave.size_check)
W: no module named numpy.asarray (top-level import by scipy.optimize.nonlin)
W: no module named termios (top-level import by tty)
W: no module named scipy.arange (conditional import by scipy.sparse.linalg.isolve.minres)
W: no module named numpy.polyder (top-level import by scipy.signal.signaltools)
W: no module named matplotlib.rcParams (top-level import by matplotlib.figure)
etc...
第一个问题:为什么我会收到这么多警告,而程序部分运行得还不错呢?
第二个问题:我该如何正确导入这些模块?在我的project.spec
文件中,我写了exe = EXE(..., a.binaries + [('scipy.weave', 'C:\Python27\Lib\site-packages', 'PYMODULE')], ...)
,但是它找不到这个模块,也无法打包任何文件?