我正在尝试在 Windows 上安装 setuptools。
文档说我应该运行 ez_setup.py。
所以我做了,我得到以下输出:
Extracting in c:\users\ut601039\appdata\local\temp\tmpf6a2mb
Now working in c:\users\ut601039\appdata\local\temp\tmpf6a2mb\setuptools-1.0
Installing Setuptools
Something went wrong during the installation.
See the error message above.
Traceback (most recent call last):
File "D:\Python\Setuptools\ez_setup.py", line 357, in <module>
sys.exit(main())
SystemExit: 2
错误消息不是很丰富。查看我发现的代码:
if not _python_cmd('setup.py', 'install', *install_args):
log.warn('Something went wrong during the installation.')
log.warn('See the error message above.')
# exitcode will be 2
return 2
我去_python_cmd()
发现:
def _python_cmd(*args):
args = (sys.executable,) + args
return subprocess.call(args) == 0
我发现subprocess.call(args)
返回 1 而不是预期的 0。