Py2exe including MSVC DLL in .exe

When using py2exe to distribute Python applications using wxPython, some .msvc dll files are usually needed for .exe to work on newly installed computers. In particular, the two most common DLLs are msvcp71.dll and msvcr71.dll

The first can be included in .exe using this tip . However, the latter is simply placed in the dist py2exe directory, and not in the executable file, even if I specifically ask you to include it.

Any idea how to get py2exe to turn on as inside .exe?

+4
source share
3 answers

Doesn't it start up? You want msvcr71.dll in the same directory as exe so that the library loader can find and link it to the applicationโ€™s memory card.

This is necessary for the basic operation, so you cannot simply py2exe unzip it along with the rest of the DLLs.

+7
source

py2exe cannot do this. You can wrap py2exe (there is an example on the wiki showing how to do this with NSIS); you can create your own wrapper if using NSIS or InnoSetup was not an option.

Alternatively, if you are sure that your users will have a compatible copy of msvcr71.dll (IIRC Vista or XP SP2 users) installed, you can leave without including it. More useful, perhaps if you are using Python 2.3 (or older), then Python links are against msvcr.dll, not msvcr71.dll, and any Windows user will be installed this way, so you can just not worry about it.

+1
source

Yes, py2exe can do this. Check out this link. And if you are using python2.7, replace msvcr71 with msvcp90.

+1
source

Source: https://habr.com/ru/post/1277554/


All Articles