Skip to content

ImportError - Swagger codegen for flask #6310

@ctippur

Description

@ctippur
Description

I am getting the following error when running flask server:
from .binary import Binary
File "/Users/ctippur/cyclops/cyclopscloud/flaskapi/cyclopsflaskglobal/python-flask-server/swagger_server/models/binary.py", line 4, in
from swagger_server.models.binary import Binary

Here is the tree for swagger server that got generated via swagger UI (http://editor.swagger.io)

├── Dockerfile
├── README.md
├── git_push.sh
├── requirements.txt
├── setup.py
├── swagger_server
│   ├── init.py
│   ├── main.py
│   ├── pycache
│   │   ├── init.cpython-36.pyc
│   │   ├── main.cpython-36.pyc
│   │   ├── encoder.cpython-36.pyc
│   │   └── util.cpython-36.pyc
│   ├── controllers
│   │   ├── init.py
│   │   └── default_controller.py
│   ├── encoder.py
│   ├── models
│   │   ├── init.py
│   │   ├── pycache
│   │   │   ├── init.cpython-36.pyc
│   │   │   ├── base_model_.cpython-36.pyc
│   │   │   ├── binary.cpython-36.pyc
│   │   │   └── body.cpython-36.pyc
│   │   ├── base_model_.py
│   │   ├── binary.py

Swagger-codegen version

I generated server code via http://editor.swagger.io

Swagger declaration file content or ur
Command line used for generation

N/A

Steps to reproduce

python3 -m venv flaskglobal
source flaskglobal/bin/activate
cp binary to flaskglobal and unzip contents
cd python-flask-server
pip install -r requirements.txt
python -m swagger_server

Could this be a pythonpath issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions