【发布时间】:2017-10-04 15:33:49
【问题描述】:
我正在尝试将我的项目编译为 .exe 文件。
我在网上了解到 cx_freeze 是一个不错的选择。 所以我有这个 setup.py 脚本:
import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["functions"], "excludes": ["tkinter"]}
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup( name = "Bacteria Data Analysis",
version = "0.1",
description = "This program analyses data from experiments",
options = {"build_exe": build_exe_options},
executables = [Executable("main.py", base=base)])
它构建得很好:python setup.py build
但是当我尝试运行我的 .exe 程序时,我得到了这个错误:
它似乎与numpy有关,但无法弄清楚如何修复它......我已经安装和卸载了numpy,但不幸的是没有运气。
我在 cmd 中运行“python”的输出如下:
Python 3.6.1 |Anaconda custom (64-bit)| (default, May 11 2017, 13:25:24)
[MSC v.1900 64 bit (AMD64)] on win32
【问题讨论】: