But generating a stand alone windows executable failed immediately:
python setup.py py2exe...bailed out with following message:
*** searching for required modules *** *** parsing results *** *** finding dlls needed *** error: MSVCP90.dll: No such file or directory
What happended?
This time I installed python with local admin rights "for all users". As noted in my first post about distributing python apps for windows python >2.6 (on the windows platform) is linked against Microsoft Visual C libraries (VC90) and the preferred way for installing those dependencies is to put them into the Windows\WinSxS system directory - where assemblies can be shared "side by side" among applications.That's exactly what the python msi installer does when it is given the "install for all users" option with the required admin-privileges. But unfortunately current versions of py2exe don't seem to check system directories when they scan for required modules and thus fail.
The workaround:
You have two options:- Locate the correct version and copy msvcp90.dll and msvcr90.dll into pythons DLLs directory
- Install Python without admin rights (for yourself only)
Howto locate required VC DLLs
- Download getassembly.py into a folder of your choice.
- Using the windows console execute (make sure to adjust the paths):
>cd C:\path\to\getassembly >python getassembly.py C:\python26\python.exe
- In the output you'll find the dependentAssembly that holds all information you need to find the correct folder for copying the correct set of DLLs:
<dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity> </dependentAssembly> - In the example above this would be on my system:
C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375
