Create Python EXE without MSVCP90.dll

前端 未结 2 2004
刺人心
刺人心 2021-01-02 14:17

I\'m trying to use Py2Exe to take a python program (using wxPython) to a Windows exe but there is an error regarding MSVCP90.dll . After reading py2exe fails to generate an

相关标签:
2条回答
  • 2021-01-02 14:40

    What is MSVCP90.dll

    MSVCP90.dll is Multithreaded, dynamic Visual Studio 2008 C Runtime Library. Generally your application should package MSVCP90.dll unless you are sure that the target machine have the matching CRT. You can use any of the packaging software to package the necessary DLLs and your software and distribute it.

    Purpose of MSVCP90.dll

    You may be wondering why you need this weird dll? Well CRT is nothing new to python. All application that is based on C heavily relies on C library functions. All the implementations of the standard C Library functions like (malloc, strcpy ..) to name a few is implemented in these libraries. There are different kinds and the specific MSDN website have more details on it. enter image description here

    Distributing MSVCP90.dll

    When distributing CRT, you should understand that depending upon what CRT you have used the version number which is suffixed with the name of the CRT varies. For example MSVCP90.DLL is the CRT from Visual Studio 2008. A single machine can contain multiple CRTs either in the system folder on in application installation path.

    If you are planning to package your application, you need to re-verify, which CRT version your application uses. Packaging wrong CRT or using one can cause undesired and undefined effect. Generally speaking the CRT your Python Installation uses, should be the same CRT you should package.

    Determining the correct MSVCRT

    As there are different CRT builds with different versions, it is difficult to ascertain, which CRT should be packaged. If you have a running application (executable), you can use dependencywalker to determine the correct version. Right click on any of the DLLs and click on properties and it will show you the location from which this DLL is being picked. enter image description here

    Packaging your application.

    You can try using PyInstaller to package your application. It would be a convenient way to get the DLL into the target machine.

    0 讨论(0)
  • 2021-01-02 15:06

    You have to deliver your app with that dll in same folder as your exe file.

    0 讨论(0)
提交回复
热议问题