使用fc_freeze创建exe文件后,软件包statsmodel和scipy出现问题

时间:2020-06-06 19:43:44

标签: python python-3.x scipy statsmodels cx-freeze

我已经对工具“ csv-data-analyze”进行了编程。 (一种分析和统计工具)

代码基于python3。我使用其他软件包。 该工具在python环境中可以很好地运行。 由于这个因素,大多数人只想使用程序而不安装python环境,所以我尝试使用cx_freeze工具创建Windows程序。

项目方面:https://github.com/blaubaer01/csv-data-analyze

如果我在cmd中使用exe文件,则程序运行不会失败。

但是,如果我在程序中使用包(模块)scipy和/或statsmodels的任何功能,则程序将中止而不会出现失败消息。

现在疯狂的消息是:如果我在Anaconda Power Shell中使用该程序;该程序运行良好。

有人知道为什么吗?

这是我的setup.py代码:

    #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 25 17:27:58 2020

@author: blaubaer (Ricky Helfgen )
Thanks to https://www.youtube.com/watch?v=Q8CLcGdr90Q
"""

###create executable file from csv-data-analyze 
###Problems with the scipy package!
###after installing change the filename: lib/scipy/spatial/cKDTree.cp37-win_amd64.pyd in ckdtree.pyd

from cx_Freeze import setup, Executable
#import sys

datei = input('Von welcher Datei willst du eine EXE erstellen: \n?')

# =============================================================================
# base = None
# 
# if sys.platform == 'win32':
#     base = 'Win32GUI'
# =============================================================================


build_exe_options = {
    "packages": ["os", "sys", "pandas", "numpy", "statsmodels", "matplotlib", "scipy", "seaborn", "outliers", "webbrowser"], 
    "excludes": ["tkinter"],
    "include_files": ["SPC_CPA.py", "L_REG.py", "table_functions.py", "regelkarte.py", "msa.py", "charts.py", "tests.py", "table_calc.py", "rand_data.py", "mft.py", "tableview.py", "mkl_core.dll", "mkl_def.dll", "mkl_intel_thread.dll", "mkl_mc.dll", "mkl_mc3.dll", "platforms/"], # <-- Include easy_gui
    "includes": ["SPC_CPA", "L_REG", "table_functions", "regelkarte", "msa", "charts", "tests", "table_calc", "rand_data", "mft", "tableview"]
}

#build_exe_options = {"packages": ['os', 'pandas', 'numpy', 'statsmodels', 'matplotlib', 'scipy', 'seaborn','outlier_utils'],
 #                                 "excludes": ["tkinter"]}



setup(version = "1.0",
      description = "Analyze CSV - File",
      name = "csv-data-analyze",
      options = {"build_exe": build_exe_options},
      executables = [Executable(datei)])

print("Fertig!")

0 个答案:

没有答案