我正在尝试在使用库 assimulo(微分方程求解器)的软件上使用 py2exe 构建可执行文件。遇到的问题是在执行过程中我收到:
ImportError:没有名为代数的模块
确切的错误信息是:
Traceback (most recent call last):
File "main.py", line 89, in <module>
from simulation.simulation import Simulation
File "simulation\simulation.pyc", line 18, in <module>
manages all the action linked to a simulation, like running, saving, replay, etc...
File "solver\assimuloSolver.pyc", line 7, in <module>
Explicit solver to choose in the list of assimulo solvers:
File "assimulo\solvers\__init__.pyc", line 25, in <module>
File "assimulo\solvers\kinsol.pyc", line 12, in <module>
File "assimulo\solvers\kinsol.pyc", line 10, in __load
File "kinsol.pyx", line 1, in init assimulo.solvers.kinsol (assimulo\solvers\kinsol.c:19711)
ImportError: No module named algebraic
这里 qe 可以看到是第 7 行产生了我的麻烦,而这一行是
from assimulo.solvers import Radau5DAE
py2exe 的 setup.py 文件如下所示:
from distutils.core import setup
from py2exe.build_exe import py2exe
import sys
from glob import glob
import matplotlib
data_files = [("Microsoft.VC90.CRT", glob(r'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*'))]
data_files.extend(matplotlib.get_py2exe_datafiles())
sys.path.append("C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\redist\\x86\\Microsoft.VC90.CRT")
excludes = ['_gtkagg', '_tkagg']
includes = [
"scipy.sparse.csgraph._validation",
"scipy.special._ufuncs_cxx",
]
opts = {
"py2exe": {
"includes":includes,
"excludes":excludes,
}
}
setup(name = "MySoft",
version = "0.1",
data_files=data_files,
windows=[{"script":"main.py"}], options=opts)
如果有人有线索,我会很感兴趣。谢谢