When trying to use py2exe to convert a simple Python game I made into exe format, it gave me the following error:
Traceback (most recent call last):
File \
From your comments, I see that you are doing this in the command prompt:
setup.py py2exe
from the py2exe tutorial's third step, you should be doing this instead (in the command promt):
python setup.py py2exe
A second look at the comments on the original question shows that this suggestion has already been made. +1 to joaquin to for this.
To try to answer your question again: Joaquin also mentioned that this might be a path issue. Rather than trying to fix that, you might want to consider the easier option of copying your python files into C:\Python. Then in the command prompt:
cd C:\Python
python setup.py py2exe
This has always worked for me
Hope this helps
I solved this problem by downloading "Microsoft Visual C++ Compiler for Python 2.7" http://www.microsoft.com/en-pk/download/details.aspx?id=44266
You can deal with py2exe and the headaches, I tried doing this, even when I had it right, it would error, though I did find the excellent python program gui2exe, this makes it extremely easy to make an exe (or any of the other supported formats).
Gui2exe: http://code.google.com/p/gui2exe/downloads/detail?name=GUI2Exe_0.5.0.zip
Examples: http://code.google.com/p/gui2exe/wiki/GUI2ExeExamples
I met the same problem and I searched and I came here . I tried the way prompt by xiao-yu but I didn't work. So I found this from http://www.py2exe.org/index.cgi/Tutorial#Step52: 5.2.1. Bundling the C runtime DLL
If you do have the rights to redistribute MSVCR90.dll, there should be a copy of it in your Visual Studio install, under VC\redist\x86\Microsoft.VC90.CRT. Since Visual Studio 2008, you can't just copy this DLL file - you also need the manifest file that you'll find there. The redist.txt file states that you must distribute all three dlls and the unmodified manifest file and it is a violation of the license agreement to distribute only one of the dlls without the others (though py2exe only needs MSVCR90.dll.) The pertinent passage from the redist.txt file is as follows:-----------------------
so ,try it.
Try installing the Microsoft Visual C++ 2008 Redistributable Package (x86): http://www.microsoft.com/downloads/en/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en
I had exact the same problem.
Since I have windows 7 64bit, I downloaded py2exe-0.6.9.win64-py2.6.amd64.exe, which I suppose to be the 64bit version of py2exe. but it did not work, and I had the same error.
I changed to py2exe-0.6.9.win32-py2.6.exe, and it worked fine.
I guess you have to match the 32bit or 64bit with the python installation instead of the windows itself.
by the way, "setup.py py2exe" or "python setup.py py2exe" really does not matter, if you instructed windows to open *.py with python during the python installation.