我已经使用 cx_Freeze
将我的 Python 3.3 应用程序编译为 .exe
,它只在我的本地机器上运行。
在另一台计算机上,首先是缺少 DLL msvcr100.dll
。
在我在那台计算机上安装 Microsoft Visual C++ 2010 Redistributable Package
之后,它没有显示任何错误,但仍然无法运行,因为没有打开任何东西。
我认为我安装了错误版本的 Microsoft Visual C++ Redistributable
。如何找出我的 Python 解释器编译时使用的 msvcrXX.dll
的版本?
最佳答案
Python 3.3 是使用 Visual Studio 2010 编译的。它使用 Msvcr100.dll。
您可以通过sys.version
或platform.python_compiler()
查看编译器:
Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import platform
>>> sys.version
'3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)]'
>>> platform.python_compiler()
'MSC v.1600 64 bit (AMD64)'
>>> ^Z
这是 Visual Studio 2010 的编译器版本:
C:\>cl
Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
更直接的,您可以直接示例Python DLL 的DLL 导入:
C:\>dumpbin /imports c:\windows\system32\python33.dll | findstr /i dll
Dump of file c:\windows\system32\python33.dll
File Type: DLL
KERNEL32.dll
USER32.dll
ADVAPI32.dll
SHELL32.dll
MSVCR100.dll
关于c++ - 我的 Python interpereter 编译的 msvcrXX.dll 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20092983/