Question

I have been plagued with this problem ever since I started with Python, I want to write a Python script, and then export it as an EXE that I can run on any Windows XP (and up) machine.

cx_Freeze covers all of this perfectly, the only problem is that it required Visual C++ Runtime to be installed on the client computer before the resulting EXE will run on it...

Is it possible to convert my beautiful *.py file into a nice distributable EXE that will run on a fresh install of Windows XP and up?

Was it helpful?

Solution

AFAIK if you have a Visual Studio licence, you have the right to bundle the appropriate msvcrXY.dll with your application. That will make it run without having to install the runtime files.

If you don't have a Visual Studio licence, I can think of two solutions:

One is to bundle the VS runtime installer with your application (if that is allowed by the licence), and make a tiny batch file/program that runs the installer if necessary, and then your program. This is not ideal if e.g. the user doesn't have admin rights.

The other option I can think of is for you to compile Python with Mingw-gcc, and then use that Python to create your frozen executable. Then it won't depend on the VS runtime libraries. This approach is of course much more complicated and will probably require quite a bit of tinkering. Perhaps someone has already done it though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top