I recently went and compiled my Tkinter application into a standalone app using py2exe. It seems to work when python is installed on the computer but when it is not installed, it shows the error - 'This application is not configured properly. Reinstalling the application may help', I read elsewhere that downgrading to python 2.5 solves this problem, but I cant, cause python 2.5 contains Tkinter 8.4 which makes my application look like crap. Please help me to solve this problem.
-vishy1618
This is purely down to .dll's. Namely the msvcrXX runtimes (msvcr70.dll, msvcr90.dll etc)
If the target machine does not have Python installed, then it needs to have the correct version of the Microsoft VC runtime installed (depending on the version of python used). I'm pretty certain it's the VC9 redistributable runtime package (msvcr90.dll) that you need to include/install in order for apps created with the Python2.6 version of py2exe to work.
The reason for this is because python2.6 was built against the msvcr90.dll, so python 2.6 depends upon the msvcr90.dll...It needs it.
Therefore, when packaging up your app ready for deployment to users, you'll need to ensure that you include the installer for the msvc90 redistributable runtime in case the users machine does not already have it (which in this case your test pc sounds like it doesn't!).
If python 2.6 is installed on your users pc (or any other app that requires the msvc90 runtime), then the msvcr90 runtime will already be installed on the machine, so your app created by py2exe will run with no problems.
Whereas if there is an earlier version of Python or no Python at all, and if there are no other apps installed which use the msvcr90.dll, then your program will fail in the manner you've already described.
As mentioned previously, to fix the issue, you need to ensure you either include a copy of the msvc90.dll in your distribution folder before creating your installer, or better still - include the official microsoft redistributable install package in your final installer package. Perhaps making it an optional component to install, or perhaps you could use a script to see whether it is installed already and automatically install it if it is not.
Either way, that will ensure that your users are able to install and use your app without any problems, regardless of whether or not Python 2.6 is installed.
So to sum up...you need the VC9 runtime on your test PC!
Try it, download and install the msvcr90 runtime on your test PC and then try running your py2exe app!
The reason Python2.5 works is because it uses the msvcr70 runtime package and the msvcr70.dll was automatically included in the distribution folder by py2exe for Python2.5.
In fact, even if you explicitly excluded the msvcr70 runtime from your py2exe build, the chances are that your app would still work as the majority of windows PC's would already have the msvcr70 runtime installed by default!
I hope this clears things up for you!
Cheers for now,
Jas.