在 Win7 64 位上编译 sqlalchemy C 扩展所需的编译器是什么



我刚刚更新了sqlalchemy并看到了以下消息:

building 'sqlalchemy.cprocessors' extension
***************************************************************************
Unable to find vcvarsall.bat
WARNING: The C extension could not be compiled, speedups are not enabled.
Failure information, if any, is above.
Retrying the build without the C extension now.
***************************************************************************

我在Windows 7 64位(WinPython发行版)上运行Python 3.3 64位。

我想编译 C 扩展,但是 Python 64 位(MinGW、Visual C++ 2010 等)的编译器有哪些选项?

特别是,是否可以使用Microsoft的Express编译器代替专业版?

最后,如果可能的话,您能否也解释一下使用特定编译器的缺点/优点?

谢谢!

更新 1:

我安装了适用于Windows 7.1的Microsoft Windows SDK,这本身就很痛苦,因为如果找到较新版本的可再发行组件,它就不会安装。

我按照cgohlke的指示进行操作,它起作用了,但有以下警告。它们是否正常/预期?

building 'sqlalchemy.cprocessors' extension
processors.c
processors.obj : warning LNK4197: export 'PyInit_cprocessors' specified multiple times; using first specification
building 'sqlalchemy.cresultproxy' extension
resultproxy.c
resultproxy.obj : warning LNK4197: export 'PyInit_cresultproxy' specified multiple times; using first specification
building 'sqlalchemy.cutils' extension
utils.c
utils.obj : warning LNK4197: export 'PyInit_cutils' specified multiple times; using first specification

谢谢!

安装免费的 Microsoft Windows SDK for Windows 7 和 .NET Framework 4,其中包含与官方 CPython 3.3 发行版相同的编译器,并在安装命令之前运行以下命令:

setlocal EnableDelayedExpansion
call "%ProgramFiles%Microsoft SDKsWindowsv7.1BinSetEnv.Cmd" /Release /x64 /vista
set DISTUTILS_USE_SDK=1

或者,在 http://www.lfd.uci.edu/~gohlke/pythonlibs/#sqlalchemy 使用二进制文件

最新更新