问题描述
我已经安装了 Microsoft Visual Studio 2008.我下载了 zip 文件 Python for Windows 扩展 并将内容提取到我的 Python27 文件夹中.现在有一个名为 pywin32-214 的子文件夹.(32 部分有问题吗?我在 64 位系统上.)这是来自命令行的抄本:
I have Microsoft Visual Studio 2008 installed already. I downloaded the zip file Python for Windows extensions and extracted the contents into my Python27 folder. There's now a subfolder called pywin32-214. (Is the 32 part a problem? I'm on a 64-bit system.) Here's a transcript from the command line:
C:Python27pywin32-214>setup.py -q install
Building pywin32 2.7.214.0
Traceback (most recent call last):
File "C:Python27pywin32-214setup.py", line 2152, in <module>
('', ('pywin32.pth',)),
File "C:Python27libdistutilscore.py", line 152, in setup
dist.run_commands()
File "C:Python27libdistutilsdist.py", line 953, in run_commands
self.run_command(cmd)
File "C:Python27libdistutilsdist.py", line 972, in run_command
cmd_obj.run()
File "C:Python27pywin32-214setup.py", line 1251, in run
install.run(self)
File "C:Python27libdistutilscommandinstall.py", line 563, in run
self.run_command('build')
File "C:Python27libdistutilscmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:Python27libdistutilsdist.py", line 972, in run_command
cmd_obj.run()
File "C:Python27pywin32-214setup.py", line 596, in run
build.run(self)
File "C:Python27libdistutilscommanduild.py", line 127, in run
self.run_command(cmd_name)
File "C:Python27libdistutilscmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:Python27libdistutilsdist.py", line 972, in run_command
cmd_obj.run()
File "C:Python27libdistutilscommanduild_ext.py", line 340, in run
self.build_extensions()
File "C:Python27pywin32-214setup.py", line 858, in build_extensions
self.compiler.initialize()
File "C:Python27libdistutilsmsvc9compiler.py", line 383, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:Python27libdistutilsmsvc9compiler.py", line 299, in query_vcvarsal
l
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
我不知道该怎么办.有帮助吗?
I don't know what to make of this. Help?
推荐答案
如果您安装了 64 位 Python:
If you have a 64 bit Python installation:
安装Microsoft Visual Studio 2008 专业版"并启用X64 编译器和工具"选项.
Install "Microsoft Visual Studio 2008 Professional Edition" with the "X64 Compiler and Tools" option enabled.
或者,从 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/
这篇关于尝试为 Windows 扩展安装 Python 时出现值错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!