简体   繁体   中英

swagger_py_codegen TypeError

I want to run a open project on github: https://github.com/baidu/Curve

When I run the command

./control.sh start

It will show the following errors:

    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'

So I read the code of control.sh and find the problem should take place when running the following command:

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

But I don't know how to solve this problem after searching the internet...

The code of swagger_py_codegen is:

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())

i also meet this problem on python 3.5.2,

then i changed python 3.7.0, but failed in another problem.

then i changed python 3.6.6rc1, and change Click version to 6.7, and no this problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM