5

I have a python application that I am trying to build as a pyinstaller distributable. A similar script builds successfully on Linux.

I am building it on Windows 7 x64, but want to build 32-bit binary for better compatibility, so I am using 32-bit python-2.7. Among my dependencies are matplotlib and pyside which require MSVC. I install a package called VCForPython27 from Microsoft.

I run into an error when I run my pyinstaller script. I get the following message:

1250 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
7428 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
7428 WARNING: Assembly not found
7428 ERROR: Assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none not found
7475 WARNING: lib not found: MSVCR90.dll dependency of C:\Python27\python.exe
7553 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
7553 WARNING: Assembly not found
7553 ERROR: Assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none not found
7662 WARNING: lib not found: MSVCR90.dll dependency of C:\Windows\system32\python27.dll
7662 INFO: Analyzing C:\Python27\lib\site-packages\PyInstaller\loader\_pyi_boots

There are multiple messages like that about both the files MSVCP90.dll and MSVCR90.dll

I can see that I have a folder C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_5090ab56bcba71c2 that contains versions of both files.

This mismatch occurs both when I install my python packages from Christoph Gohlke's page and with pip (except for matplotlib, which I can't install with pip because of missing dependencies).

Strangely enough pyinstaller makes a binary. Yet, when I try to run it I get a popup saying:

WARNING: file already exists but should not:
C:\Users\Martin\AppData\Local\Temp\_MEI34922\Include\pyconfig.h

Does anyone know how I can do any of the following:

  1. Install the precious x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none assembly? Where can I take this specific version from?
  2. Tell python to look for the other version (x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_5090ab56bcba71c2)?
  3. Solve the pyconfig.h unwanted presence issue? Doesn't seem to lead anywhere, but I thought I should try it too.
  4. Find another way to build my code to a binary? It's a complicated code, running external binaries, but if I have to I will try py2exe, not sure that it would be any better though.
mapto
  • 605
  • 9
  • 23
  • 1
    A workaround for the `pyconfig.h` issue is put forward [here](http://stackoverflow.com/questions/19055089/pyinstaller-onefile-warning-pyconfig-h-when-importing-scipy-or-scipy-signal). – mapto Oct 19 '14 at 01:03

1 Answers1

11

The redistributable package that contains version 9.0.21022.8 of msvcr90.dll and msvcp90.dll can be downloaded from the Microsoft website here. This will help PyInstaller to find the versions it wants and include them with the resulting executable.

Interestingly enough, I'm able to run the executable compiled by PyInstaller with redistributable version 9.0.30729.6161 installed, it just won't package these dlls. I tried to copy the msvc*90.dll's into the dist directory, even tried creating and modifying manifest files, but I would still get an error from python27.dll in the end. Installing any version of VC++ redistributable would fix the issue, but then my package wouldn't be self-containing. I wish I understood what exactly is going on here better...

dkobozev
  • 2,265
  • 2
  • 21
  • 21