gpt4 book ai didi

python - swagger_py_codegen 类型错误

转载 作者:太空宇宙 更新时间:2023-11-03 21:44:34 25 4
gpt4 key购买 nike

我想在github上运行一个开放项目:https://github.com/baidu/Curve

当我运行命令时

./control.sh start

它将显示以下错误:

    Traceback (most recent call last):
File "/Users/sx/PycharmProjects/Curve/venv/bin/swagger_py_codegen", line 11, in <module>
sys.exit(generate())
File "/Users/sx/PycharmProjects/Curve/venv/lib/python2.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/Users/sx/PycharmProjects/Curve/venv/lib/python2.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/Users/sx/PycharmProjects/Curve/venv/lib/python2.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/sx/PycharmProjects/Curve/venv/lib/python2.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
TypeError: generate() got an unexpected keyword argument 'swagger'

所以我阅读了control.sh的代码,发现问题应该发生在运行以下命令时:

swagger_py_codegen --ui --spec -s doc/web_api.yaml api -p curve

但是我在网上搜索后不知道如何解决这个问题...

swagger_py_codegen的代码是:

import re
import sys

from swagger_py_codegen import generate

if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(generate())

最佳答案

我在 python 3.5.2 上也遇到了这个问题,

然后我改变了python 3.7.0,但在另一个问题上失败了。

然后我改了python 3.6.6rc1,并把Click版本改成6.7,就没有这个问题了。

关于python - swagger_py_codegen 类型错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52584921/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com