我有一臺Win7 x64機器上運行的Python 2.6和Visual Studio 2008。 當我嘗試建立在C「example_nt」的基本Python擴展例如在蟒蛇2.6源代碼分發發現,它失敗:試圖構建基本的python擴展示例失敗(windows)
python setup.py build
,這導致:
running build
running build_ext
building 'aspell' extension
Traceback (most recent call last):
File "setup.py", line 7, in <module>
ext_modules = [module1])
File "C:\Python26\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python26\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "C:\Python26\lib\distutils\command\build.py", line 134, in run
self.run_command(cmd_name)
File "C:\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "C:\Python26\lib\distutils\command\build_ext.py", line 343, in run
self.build_extensions()
File "C:\Python26\lib\distutils\command\build_ext.py", line 469, in build_extensions
self.build_extension(ext)
File "C:\Python26\lib\distutils\command\build_ext.py", line 534, in build_extension
depends=ext.depends)
File "C:\Python26\lib\distutils\msvc9compiler.py", line 448, in compile
self.initialize()
File "C:\Python26\lib\distutils\msvc9compiler.py", line 358, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python26\lib\distutils\msvc9compiler.py", line 274, in query_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
我能要解決這個問題嗎?任何幫助將不勝感激
確保您從具有適當環境變量集的「Visual Studio命令提示符」運行,並且您正在使用的Python版本與比特位(32/64)匹配,的編譯器。 – 2011-01-08 19:47:16
這是http://stackoverflow.com/questions/4624507 – cgohlke 2011-01-09 01:36:22