我的Python interpreter使用的msvcrXX.dll版本

Version of msvcrXX.dll that my Python interpereter compiles with

本文关键字:msvcrXX dll 版本 Python interpreter 我的      更新时间:2023-10-16

我已经将我的Python 3.3应用程序编译为带有cx_Freeze.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.versionplatform.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:windowssystem32python33.dll | findstr /i dll
Dump of file c:windowssystem32python33.dll
File Type: DLL
    KERNEL32.dll
    USER32.dll
    ADVAPI32.dll
    SHELL32.dll
    MSVCR100.dll