【发布时间】:2014-03-08 01:48:41
【问题描述】:
我正在尝试使用 cxFreeze 为我的 python 脚本编译一个可执行文件。在我需要为我的脚本导入的许多库中,有两个似乎因 cxFreeze 而失败。特别是,请考虑以下 test.py 脚本:
print('matplotlib.pyplot')
import matplotlib.pyplot
使用 cxFreeze 编译并运行会得到以下输出:
另外,下面的 test.py 脚本:
print('BeautifulSoup from bs4')
from bs4 import BeautifulSoup
使用 cxFreeze 编译后,产生以下输出:
我的 cxFreeze 的 setup.py 文件如下所示:
import sys
from cx_Freeze import setup, Executable
setup(
name = "myname",
version = "1.0",
description = "some description",
executables = [Executable("test.py", base = None)]
)
我正在运行 Python 3.3 x86,并在 Windows 7 上使用 32 位版本的 cxFreeze(最新)。
我在追查这个问题时遇到了麻烦。一方面,我的计算机上不存在目录“C:\Python\32-bit...”,所以我不清楚 cxFreeze 为何试图查看那里。有谁知道如何解决这个问题,或者可能已经处理过这个问题?
【问题讨论】:
标签: python matplotlib beautifulsoup cx-freeze