2014-03-30 62 views
0

我剛剛更新SQLAlchemy的,看到以下消息:在Win7 64位上編譯sqlalchemy C擴展所需的編譯器是什麼?

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編譯器代替Professional版本嗎?

最後,如果可能的話,你也可以解釋一下使用特定編譯器的優缺點嗎?

謝謝!

更新1:

我安裝的是微軟的Windows SDK的Windows 7.1,這本身就是一種痛苦,因爲如果再發行的新版本中發現它並沒有安裝。

我遵循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 

謝謝!

回答

2

免費安裝Microsoft Windows SDK for Windows 7 and .NET Framework 4,其中包含由官方CPython的3.3分佈中使用的相同的編譯器,並且執行安裝命令之前以下命令:

setlocal EnableDelayedExpansion 
call "%ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /Release /x64 /vista 
set DISTUTILS_USE_SDK=1 

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

+0

由於,它工作完美。 – antoniobotelho