我正在 Windows 7 64 位机器上设置 python 的密码器。我正在使用 setup.py 模块来实现这一点。我使用 setup.py 而不是 pip 的原因是因为我正在安装它的机器没有外部互联网访问权限,因此 pip 将无法工作。
我已经使用 Windows SDK 安装了 64 位 c++ 编译器,并按照以下链接中的说明在 cmd 行上运行了以下命令。
- 列表项 cd "C:\Program Files\Microsoft SDKs\Windows\v7.1"
- 列表项 cmd /V:ON /K Bin\SetEnv.Cmd /x64 /release
- 列表项设置 DISTUTILS_USE_SDK=1
当我运行 setup.py 时,我收到以下错误消息:
File "setup.py", line 443, in <module>
set_compiler_options(package_root, ext_modules)
File "C:\Python33\cryptodome\pycryptodome-3.8.2\compiler_opt.py", line 304, in
set_compiler_options
clang = compiler_is_clang()
File "C:\Python33\cryptodome\pycryptodome-3.8.2\compiler_opt.py", line 239, in
compiler_is_clang
return test_compilation(source, msg="clang")
File "C:\Python33\cryptodome\pycryptodome-3.8.2\compiler_opt.py", line 82, in
test_compilation
objects = compiler.compile([fname], extra_postargs=extra_cc_options)
File "C:\Python33\lib\distutils\msvc9compiler.py", line 461, in compile
self.initialize()
File "C:\Python33\lib\distutils\msvc9compiler.py", line 372, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python33\lib\distutils\msvc9compiler.py", line 288, in query_vcvarsal
raise ValueError(str(list(result.keys())))
ValueError: ['path']
这是看起来与错误相关的代码:
#looks to contain a set of possible environment variable names
interesting = set(("include", "lib", "libpath", "path"))
#populates result with keys and values from actual environment variables
stdout = stdout.decode("mbcs")
for line in stdout.split("\n"):
line = Reg.convert_mbcs(line)
if '=' not in line:
continue
line = line.strip()
key, value = line.split('=', 1)
key = key.lower()
if key in interesting:
if value.endswith(os.pathsep):
value = value[:-1]
result[key] = removeDuplicates(value)
#tests whether all the keys within result are in interesting
if len(result) != len(interesting):
raise ValueError(str(list(result.keys())))
这可能是由于环境变量中的一些缺失值造成的吗?如果是这样,那些山谷应该是什么?