我不得不对AndiDog的方法进行以下修改:setup.py build -cmingw32
setup.py install --skip-build
如果没有--skip build选项,安装程序将尝试重新生成并再次抱怨MSVC:error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
另外,最初使用build命令时,我有很多错误,比如:build\temp.win32-2.5\Release\ssl\_ssl2.o:_ssl2.c:(.text+0x1d): undefined reference to `_imp__PyImport_ImportModule'
build\temp.win32-2.5\Release\ssl\_ssl2.o:_ssl2.c:(.text+0x34): undefined reference to `_imp__PyObject_GetAttrString'
build\temp.win32-2.5\Release\ssl\_ssl2.o:_ssl2.c:(.text+0x53): undefined reference to `_imp__PyCObject_AsVoidPtr'
这是因为我最初安装了64位版本的Python2.5.4(Python-2.5.4.amd64.msi)。我删除了它并安装了32位版本(python-2.5.4.msi)。这包括libpython25.a文件,build命令正在查找该文件。