2014-12-19 78 views
4

我正在尝试为python文件创建一个exe文件。 py2exe创建可执行文件,但是当我运行可执行文件,我得到以下回溯:py2exe没有模块名为lgamma

C:\Users\gkumar7\Desktop\AL_gui-master\AL_gui-master\dist>app.exe 
Traceback (most recent call last): 
    File "app.py", line 5, in <module> 
    File "learning_curve.pyc", line 13, in <module> 
    File "sklearn\metrics\__init__.pyc", line 34, in <module> 
    File "sklearn\metrics\scorer.pyc", line 30, in <module> 
    File "sklearn\metrics\cluster\__init__.pyc", line 8, in <module> 
    File "sklearn\metrics\cluster\supervised.pyc", line 18, in <module> 
    File "sklearn\metrics\cluster\expected_mutual_info_fast.pyc", line 12, in <mod 
ule> 
    File "sklearn\metrics\cluster\expected_mutual_info_fast.pyc", line 10, in __lo 
ad 
    File "expected_mutual_info_fast.pyx", line 1, in init sklearn.metrics.cluster. 
expected_mutual_info_fast (sklearn\metrics\cluster\expected_mutual_info_fast.c:5 
007) 
ImportError: No module named lgamma 

这里是我的setup.py文件:

dll_excludes = ['MSVCP90.dll', 'OLEAUT32.dll', 'USER32.dll', 'IMM32.dll', 'SHELL32.dll', 
       'ole32.dll', 'COMDLG32.dll', 'COMCTL32.dll', 'ADVAPI32.dll', 'mfc90.dll', 'msvcrt.dll', 
       'WS2_32.dll', 'WINSPOOL.DRV', 'GDI32.dll', 'VERSION.dll', 'KERNEL32.dll', 'ntdll.dll'] 

from distutils.core import setup 
import py2exe, matplotlib, numpy 
setup(console=['app.py'], 
     data_files=matplotlib.get_py2exe_datafiles(), 
     options = {"py2exe": { 
          "dll_excludes": dll_excludes, 
          "includes": ['scipy.sparse.csgraph._validation', 
             'scipy.special._ufuncs_cxx'] 
         } 
       },) 

我也曾尝试cx_freeze,但保留接收类似错误。任何帮助将非常感激。

回答

3

在您的py2exe安装文件中包含sklearn.utils.lgamma

+0

少一个错误:) – dashesy 2015-09-27 00:08:25