5

I'm not a windows user typically, but I need to build exe's from my python code so I'd like to use py2exe to do this. I have an XP system where I installed python 2.6.6. I downloaded the py2exe-0.6.9 source, but when I attempted to install (via "python setup.py install"), I got the error "Unable to find vcvarsall.bat". I googled and came across this post where a respondent suggested installing a customized version of the MinGW GCC binaries available here. I did so, and now when I attempt to install py2exe I get a new error. Here is the output:

C:\Documents and Settings\Administrator\Desktop\py2exe-0.6.9>python setup.py install
C:\Documents and Settings\Administrator\Desktop\py2exe-0.6.9\py2exe\build_exe.py:16: DeprecationWarning: the sets module is deprecated
  import sets
running install
running build
running build_py
running build_ext
building '_memimporter' extension
creating build\temp.win32-2.6
creating build\temp.win32-2.6\Release
creating build\temp.win32-2.6\Release\source
c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -DPYTHONDLL=\"PYTHON26.DLL\" -DPYTHONCOM=\"pythoncom26.dll\" -IC:\Python26\include -IC:\Python26\PC -c source/MemoryModule.c -o build\temp.win32-2.6\Release\source\memorymodule.o
source/MemoryModule.c:30: warning: ignoring #pragma warning
source/MemoryModule.c: In function 'BuildImportTable':
source/MemoryModule.c:364: warning: pointer targets in passing argument 1 of 'MyLoadLibrary' differ in signedness
source/MemoryModule.c: In function 'GetNameTable':
source/MemoryModule.c:610: warning: passing argument 4 of 'qsort' from incompatible pointer type
source/MemoryModule.c: In function 'MemoryGetProcAddress':
source/MemoryModule.c:637: warning: passing argument 5 of 'bsearch' from incompatible pointer type
c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -DPYTHONDLL=\"PYTHON26.DLL\" -DPYTHONCOM=\"pythoncom26.dll\" -IC:\Python26\include -IC:\Python26\PC -c source/_memimporter_module.c -o build\temp.win32-2.6\Release\source\_memimporter_module.o

In file included from source/_memimporter.c:8,
                 from source/_memimporter_module.c:2:
source/Python-version.h:13: error: redefinition of typedef 'Py_ssize_t'
C:\Python26\include/pyport.h:115: error: previous declaration of 'Py_ssize_t' was here
error: command 'gcc' failed with exit status 1
Community
  • 1
  • 1
Mike Lawrence
  • 1,641
  • 5
  • 20
  • 40
  • 4
    Do you really need to compile it? There are win binaries? – Sugarel May 13 '11 at 14:30
  • 2
    *smacks head* I clearly didn't look hard enough at the sourceforge site. I simply clicked the "Looking for the latest version? Download py2exe-0.6.9.zip (149.7 KB)" link, not realizing that if I explored the other downloads there would be a binary. Thanks! I'll keep this question alive in case its important to anyone to solve the building problem. – Mike Lawrence May 13 '11 at 15:04
  • 1
    Is your code python only? if yes then you should be able to compile it to exe without c-compiller. It will just include all the DLLs (excluding OS's ones). About vcvarsall.bat: this is a configuration bat file from Visual Studio. Download express (free) edition and you should be fine. This bat file set all the environment variables like pathes to binaries, directories needed along development. Wish you a good resolution – Pavlonator May 16 '11 at 05:47
  • 1
    I really strongly encourage PyInstaller because you download it and in its directory you just run python pyinstaller.py "c:\your path to your file.py" --onefile --noconsole and you are done. I realize this is not an answer but try it out, its that simple. – Guillermo Siliceo Trueba Jun 06 '11 at 17:00
  • Re the VS error (Unable to find vcvarsall.bat): try running python from a VS command prompt. Maybe it'll find it if the path is set properly? – shash Jun 24 '11 at 12:17

1 Answers1

0

http://bugs.python.org/issue1485576 might be a bug you may want to re-open, providing your testcase to support it.