【发布时间】:2016-08-17 15:14:52
【问题描述】:
我正在尝试在 Debian 8 机器上使用 cx_freeze 冻结 Python 程序,但遇到以下错误消息:
copying /usr/lib/python2.7/dist-packages/matplotlib/mpl-data -> build/exe.linux-x86_64-2.7/mpl-data
error: [Errno 2] No such file or directory: '/usr/lib/python2.7/dist-packages/matplotlib/mpl-data'
我的 setup.py 文件包含:
from cx_Freeze import setup, Executable
buildOptions = {
"excludes": ["PyQt5"]}
# PyQt5 conflicts with PyQt4
base = None
executables = [
Executable('test_fitfuns.py', base=base)
]
setup(name='testfitfuns',
version = '1.0',
description = 'test fit functions',
options = dict(build_exe = buildOptions),
executables = executables)
我发现我的 mpl-data 目录在"/usr/share/matplotlib/mpl-data",所以我尝试将此行添加到buildOptions:
"include_files": [("/usr/share/matplotlib/mpl-data", "mpl-data")],
如果我这样做,我的错误会变成:
error: [Errno 21] Is a directory: 'build/exe.linux-x86_64-2.7/mpl-data'
接下来我应该尝试什么?
这是我第一次尝试使用 cx_freeze,所以如果这是一个微不足道的问题,我深表歉意。
【问题讨论】:
标签: python matplotlib debian cx-freeze