Python 2.7 Python:安装sip

Python 2.7 Python:安装sip,python-2.7,build,module,Python 2.7,Build,Module,我想根据Windows 7计算机上的文档安装python模块sip(版本4.17): 从官方页面下载,如中所述 将存储库解压缩到文件夹C:\Python27\Lib\site packages\sip-4.17 使用此文件夹中的命令python.exe Configure.py配置包 构建模块mingw32 make失败 Mingw的make返回以下错误消息: mingw32-make[1]: Entering directory 'C:/Python27/Lib/site-packages

我想根据Windows 7计算机上的文档安装python模块sip(版本4.17):

  • 从官方页面下载,如中所述
  • 将存储库解压缩到文件夹
    C:\Python27\Lib\site packages\sip-4.17
  • 使用此文件夹中的命令
    python.exe Configure.py
    配置包
  • 构建模块
    mingw32 make
    失败
Mingw的make返回以下错误消息:

mingw32-make[1]: Entering directory 'C:/Python27/Lib/site-packages/sip-4.17/sipgen'
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o main.o main.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o transform.o transform.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o gencode.o gencode.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o extracts.o extracts.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o export.o export.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o heap.o heap.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o parser.o parser.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o lexer.o lexer.c
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -Wl,-s -o sip.exe main.o transform.o gencode.o extracts.o export.o heap.o parser.o lexer.o
mingw32-make[1]: Leaving directory 'C:/Python27/Lib/site-packages/sip-4.17/sipgen'
mingw32-make[1]: Entering directory 'C:/Python27/Lib/site-packages/sip-4.17/siplib'
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\include -o siplib.o siplib.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\include -o apiversions.o apiversions.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\include -o descriptors.o descriptors.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\include -o qtlib.o qtlib.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\include -o threads.o threads.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\include -o objmap.o objmap.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\include -o voidptr.o voidptr.c
gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\include -o array.o array.c
g++ -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\include -o bool.o bool.cpp
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -shared -Wl,-subsystem,console -Wl,-s -o sip.pyd siplib.o apiversions.o descriptors.o qtlib.o threads.o objmap.o voidptr.o array.o bool.o -LC:\Python27\libs -lpython27
C:\Python27\libs/libpython27.a: error adding symbols: File format not recognized

collect2.exe: error: ld returned 1 exit status
Makefile:36: recipe for target 'sip.pyd' failed
mingw32-make[1]: *** [sip.pyd] Error 1
mingw32-make[1]: Leaving directory 'C:/Python27/Lib/site-packages/sip-4.17/siplib'
Makefile:3: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
我不知道为什么编译失败的代码是
无法识别文件格式
。这和我的错误一样吗? 提前感谢您的帮助

评论: 我也遵循了以下问题,但我想使用zip文件安装它-这样我就知道安装了什么


您是如何配置SIP的?您需要选择一个配置选项(请参阅SIP归档文件的docs文件中的文档)。一旦我选择了平台win32-g++,我就可以使用它