I will confess I'm very new to Python and I don't really know what I'm doing yet. Recently I created a very small Windows application using Python 2.6.2 and wxPython 2.8. And it works great; I'm quite pleased with how well it works normally. By normally I mean when I invoke it directly through the Python interpreter, like this:
> python myapp.py
However, I wanted to go a step further and actually compile this into a standalone executable file. So I followed these instructions from the wxPython wiki which utilize py2exe. At first it gave me errors in the command line, saying MSVCR90.dll was missing. Then I copied MSVCR90.dll to my Python\DLLs folder. That looked at first like it fixed it, since it successfully did what it needed to do. It did finish with a quick warning that there were some DLL files the program depends on and I may or may not need to distribute them.
So I navigated into the dist folder that py2exe had created and tried running my executable. But trying to open it only popped up an error dialog that said:
This application failed to start because MSVCR90.dll was not found.
Re-installing the application may fix this problem.
So I went ahead and copied MSVCR90.dll again into this dist folder. But that didn't do the trick. Then I copied it into the WINDOWS\system32 directory. That didn't do it either. What do I need to do to get this thing to work?
You can't just copy msvcr*.dll - they need to be set up using the rules for side-by-side assemblies. You can do this by installing the redistributable package as Sam points out, or you can put them alongside your executables as long as you obey the rules.
See the section "Deploying Visual C++ library DLLs as private assemblies" here: How to Deploy using XCopy for details, but basically your application looks like this:
c:\My App\MyApp.exe
c:\My App\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest
c:\My App\Microsoft.VC90.CRT\msvcr90.dll
One benefit of this is that non-admin users can use your app (I believe you need to be an admin to install the runtime via the redistributable installer). And there's no need for any installer - you can just copy the files onto a PC and it all works.
I believe installing Microsoft C++ Redistributable Package will install the DLL you need correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With