如何在没有错误的情况下构建 py2exe? [英] How can I build py2exe without errors?

查看:49
本文介绍了如何在没有错误的情况下构建 py2exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通常不是 Windows 用户,但我需要从我的 python 代码构建 exe,所以我想使用 py2exe 来执行此操作.我有一个安装了 python 2.6.6 的 XP 系统.我下载了 py2exe-0.6.9 源代码,但是当我尝试安装(通过python setup.py install")时,出现错误无法找到 vcvarsall.bat".我用谷歌搜索并发现了这篇文章一位受访者建议安装定制版本的 MinGW GCC 二进制文件,可在此处使用.我这样做了,现在当我尝试安装 py2exe 时出现新错误.这是输出:

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

推荐答案

http://bugs.python.org/issue1485576 可能是您可能想要重新打开的错误,并提供您的测试用例来支持它.

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

这篇关于如何在没有错误的情况下构建 py2exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆