【发布时间】:2012-08-26 05:37:46
【问题描述】:
我正在尝试通过执行python setup.py py2exe从源代码构建一个包
这是 setup.py 中的代码部分,我想是相关的:
if sys.platform == "win32": # For py2exe.
import matplotlib
sys.path.append("C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\redist\\x86\\Microsoft.VC90.CRT")
base_path = ""
data_files = [("Microsoft.VC90.CRT", glob.glob(r"C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*")),
它显示的错误:
*** finding dlls needed ***
error: MSVCP90.dll: No such file or directory
但我已经安装了“Microsoft Visual C++ 2008 Redistributable Package”。我在 64 位 Windows 8 上运行 32 位 python。我正在尝试构建 32 位二进制文件.
也没有这样的文件夹:“C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\”。这是我的计算机包含的内容:
编辑:
在我的 C:\ 驱动器上搜索 msvcp90.dll 时,我发现它们安装在如下奇怪的路径中:
【问题讨论】:
-
这段代码是否成功:
import ctypes; lib = ctypes.WinDLL('msvcp90.dll') -
@DavidHeffernan:是的,这段代码在 python shell (IDLE) 中成功。执行你的代码后,如果我运行, >>>lib" 它说
-
看起来 py2exe 有点时髦
-
我认为它会在 SxS 缓存中。我对py2exe一无所知。对不起。
标签: python visual-c++ python-2.7 py2exe