我在通过numpy
导出我的脚本(使用scipy
和py2exe
库)时遇到了这个问题:
Traceback (most recent call last):
File "imPok.py", line 3, in <module>
File "scipy\misc\__init__.pyc", line 49, in <module>
File "scipy\special\__init__.pyc", line 603, in <module>
File "scipy\special\basic.pyc", line 18, in <module>
File "scipy\special\orthogonal.pyc", line 101, in <module>
File "scipy\linalg\__init__.pyc", line 188, in <module>
File "scipy\linalg\_decomp_update.pyc", line 12, in <module>
File "scipy\linalg\_decomp_update.pyc", line 10, in __load
File "scipy/linalg/_decomp_update.pyx", line 1, in init scipy.linalg._decomp_update (scipy\linalg\_decomp_update.c:35768)
ImportError: No module named cython_blas
尝试:
scipy
依赖项 - 这是有效的,即麻烦在scipy
和py2exe
之间合作。问题:
附录
这些是有问题的路线:
from scipy.misc import imread
import numpy as np
我实际上还没有要求scipy.linalg
和scipy.special
,而py2exe
却想要它们。
答案 0 :(得分:5)
我今天遇到了这个问题,并从here找到了更全面的解决方案。
opts = {"py2exe": {
"includes": ['scipy', 'scipy.integrate', 'scipy.special.*','scipy.linalg.*']}}
然后,在您的setup.py脚本中,使用:
setup(options=opts,windows=['script.py'])
答案 1 :(得分:3)
scipy.misc
必须以scipy.linalg.cython_blas
作为依赖项。要解决此问题,请在py2exe安装脚本中的“options&gt; include”级别包含以下包:
scipy.linalg.cython_blas