py2exe导入numpy和scipy

时间:2016-07-04 12:55:25

标签: python numpy scipy py2exe

我使用py2exe来构建一个使用scipy和numpy的程序的exe,当我尝试运行程序时,我在日志文件中得到了下一个错误。

Traceback (most recent call last):
File "GLP2-e Admin.pyw", line 24, in <module>
File "C:\Python34\lib\site-packages\scipy\ndimage\__init__.py", line 161, in <module>
from .filters import *
File "C:\Python34\lib\site-packages\scipy\ndimage\filters.py", line 37, in <module>
from scipy.misc import doccer
File "C:\Python34\lib\site-packages\scipy\misc\__init__.py", line 51, in <module>
from scipy.special import comb, factorial, factorial2, factorialk
File "C:\Python34\lib\site-packages\scipy\special\__init__.py", line 629, in <module>
from .basic import *
File "C:\Python34\lib\site-packages\scipy\special\basic.py", line 18, in <module>
from . import orthogonal
File "C:\Python34\lib\site-packages\scipy\special\orthogonal.py", line 101, in <module>
from scipy import linalg
File "C:\Python34\lib\site-packages\scipy\linalg\__init__.py", line 190, in <module>
from ._decomp_update import *
File "<loader>", line 10, in <module>
File "<loader>", line 8, in __load
ImportError: (No module named 'scipy.linalg.cython_blas') 'Y:\\Factory\\GLP2-e Admin (Todos los archivos)\\Compilaciones\\Versión 2.1\\dist\\scipy.linalg._decomp_update.pyd'

我尝试过像我这样的setup.py文件:

options  ={
    'py2exe': {
        'bundle_files' : 3,
        r'includes':[r'scipy.sparse.csgraph._validation',
                     r'scipy.special._ufuncs_cxx',],
        'packages' : ['encodings'],
        }
    },

但它不起作用,我仍然得到那个错误。 我不知道如何解决这个问题...... 希望您能够帮助我。 感谢。

1 个答案:

答案 0 :(得分:0)

我一直在解决这个问题,在我的setup.py的“includes”部分添加了日志文件将我丢失的所有文件。在7个文件之后,程序运行没有任何错误。