我正在尝试安装索引器,但收到以下错误。有人能帮我吗?
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gnyzkvn1/indexer/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gnyzkvn1/indexer/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-gnyzkvn1/indexer/pip-egg-info
cwd: /tmp/pip-install-gnyzkvn1/indexer/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-gnyzkvn1/indexer/setup.py", line 107
except OSError, ex:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Python3不允许像Python2那样用逗号分隔错误消息。您应该使用一个额外的print((语句。
except OSError as ex:
print(ex.args)
正如文件所说:
try: raise Exception('spam', 'eggs') except Exception as inst: print(type(inst)) # the exception instance print(inst.args) # arguments stored in .args
这就是except OSError, ex:
给出错误的原因。