我在 Windows Vista 上使用 python 创建了一些程序。但是我想在 Windows XP 上部署它。是否有必要在 windows XP 上重新构建?或者有可能构建适用于这两个系统的构建?
编辑(编辑 2 - 非常简单的程序也不起作用): 我的设置:
from distutils.core import setup
import py2exe
setup(console=['orderer.py'])
使用依赖项浏览器我检查了依赖项是:
msvcr90.dll
kernel32.dll
+ntdll.dll
几乎解决了:
我发现安装:http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en做事。但是我之前尝试过手动提供msvrc90.dll,但是没有用,有什么办法可以自动重新分发吗?或者我必须向他提供此安装文件。
最后也是主要问题
现在我遇到了 msvcrt.dll 的问题。在 windows xp 上出现的消息:
The procedure entry point wcsscpy_s could not be located in the dynamic link library msvcrt.dll
我在 vista 上的版本是 7.0.6001.18000
但是在 XP 7.0.2600.5512 上
有办法解决这个问题吗?
似乎我没有排除一些 dll 的...愚蠢的错误:
$ grep -lir msvcrt.dll .
./buildout
./buildtest.py
./dist/ACTIVEDS.dll
./dist/adsldpc.dll
./dist/ATL.DLL
./dist/credui.dll
./dist/DSOUND.dll
./dist/MAPI32.dll
./dist/PROPSYS.dll
./dist/WLDAP32.dll
现在可以了!
最佳答案
在 py2exe 和 msvcr90.dll、msvcp90.dll 和 msvcm90.dll 文件创建的可执行文件旁边创建一个名为“Microsoft.VC90.CRT.manifest”的文件,其中包含以下内容:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable/>
<assemblyIdentity
type="win32"
name="Microsoft.VC90.CRT"
version="9.0.21022.8"
processorArchitecture="x86"
publicKeyToken="1fc8b3b9a1e18e3b"
/>
<file name="msvcr90.dll" />
<file name="msvcp90.dll" />
<file name="msvcm90.dll" />
</assembly>
关于python - 是否可以在 Vista 上构建 exe 并使用 py2exe 在 XP 上部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4635356/