Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errror importing swagger_client Python module #20

Open
fmussi opened this issue Oct 1, 2018 · 1 comment
Open

Errror importing swagger_client Python module #20

fmussi opened this issue Oct 1, 2018 · 1 comment
Labels
bug Something isn't working codegen Issue with swagger-codegen

Comments

@fmussi
Copy link

fmussi commented Oct 1, 2018

Steps done:

  1. Generated pyhon client from tag.yml -> Ok
  2. installed on Debian machine with python3 ('3.5.3 (default, Sep 27 2018, 17:25:39) \n[GCC 6.3.0 20170516]')
    2.1 -> unzip python-client-generated.zip
    2.2 -> pip install python-client
  3. when I run python and import swagger_client, get this error

/usr/bin/python3.5 /home/fmussi/atomProjs/sandbox/skyline/test_SMSapi_swagger.py
Traceback (most recent call last):
File "/home/fmussi/atomProjs/sandbox/skyline/test_SMSapi_swagger.py", line 3, in
import swagger_client
File "/home/fmussi/.local/lib/python3.5/site-packages/swagger_client/init.py", line 19, in
from swagger_client.api.selections_api import SelectionsApi
File "/home/fmussi/.local/lib/python3.5/site-packages/swagger_client/api/init.py", line 6, in
from swagger_client.api.selections_api import SelectionsApi
File "/home/fmussi/.local/lib/python3.5/site-packages/swagger_client/api/selections_api.py", line 21, in
from swagger_client.api_client import ApiClient
File "/home/fmussi/.local/lib/python3.5/site-packages/swagger_client/api_client.py", line 27, in
import swagger_client.models
File "/home/fmussi/.local/lib/python3.5/site-packages/swagger_client/models/init.py", line 20, in
from swagger_client.models.error import Error
File "/home/fmussi/.local/lib/python3.5/site-packages/swagger_client/models/error.py", line 19, in
from swagger_client.models.error import Error # noqa: F401,E501
ImportError: cannot import name 'Error'

Process finished with exit code 1

@spanglerco
Copy link
Contributor

This is an issue in the swagger-codegen for Python: swagger-api/swagger-codegen#7541. The Error model recursively references itself, and the Python client codegen is trying to import itself. There appears to be a pull request up to fix it, but it hasn't had any activity in a few months.

@spanglerco spanglerco added bug Something isn't working codegen Issue with swagger-codegen labels Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working codegen Issue with swagger-codegen
Projects
None yet
Development

No branches or pull requests

2 participants