【发布时间】:2015-12-02 17:43:19
【问题描述】:
我正在尝试将我的 Python 脚本导出到高性能集群(运行 CentOS 6),同时避免安装其他 Python 包的需要。我使用了一个虚拟 CentOS 6 环境,在该环境中安装了所有必需的软件包,以使用 cx_freeze 创建一个可执行文件,然后我可以将其传输到集群中执行。
我在使用 scipy 和 cx_freeze 时遇到了一些错误,我认为现在可以解决(感谢 StackOverflow 上关于此主题的大量文档)。
但是,我立即收到另一个我不明白的错误。我找不到有关缺少的假定模块的任何信息,也找不到错误本身的信息,更不用说与cx_freeze 结合使用了。
当我尝试运行可执行文件时产生以下错误:
ImportError: No module named core_cy
我使用文件中的以下setup.py 使用 cx_freeze 构建可执行文件:
import sys
import scipy
from os import path
from cx_Freeze import setup, Executable
includefiles_list=[]
scipy_path = path.dirname(scipy.__file__)
includefiles_list.append(scipy_path)
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os"], "include_files": includefiles_list}
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
setup( name = "CD34Filter",
version = "0.1",
description = "CD34Filter Script",
options = {"build_exe": build_exe_options},
executables = [Executable("cd34_filter.py", base=base)])
我已经尝试将"excludes": ["core_cy"] 选项添加到build_exe_options。但这并没有起到任何作用。
提前谢谢你!
【问题讨论】: