Open kannkyo opened 4 years ago
I fixed this same issue by updating connexion to 2.x.x. The master branch already generates a requirements.txt file with an updated connexion version
I had this same issue with the latest clone.
I have the same FileStorage error using:
connexion==2.3.0
Flask==1.1.2
Werkzeug==1.0.1
During handling of the above exception, another exception occurred:
../../../venv/py37/lib/python3.7/site-packages/py/_path/local.py:704: in pyimport
__import__(modname)
../../../venv/py37/lib/python3.7/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
source_code/tests/conftest.py:6: in <module>
from test_api.run import create_app
source_code/test_api/run.py:3: in <module>
import connexion
../../../venv/py37/lib/python3.7/site-packages/connexion/__init__.py:5: in <module>
from .apis import AbstractAPI # NOQA
../../../venv/py37/lib/python3.7/site-packages/connexion/apis/__init__.py:1: in <module>
from .abstract import AbstractAPI # NOQA
../../../venv/py37/lib/python3.7/site-packages/connexion/apis/abstract.py:10: in <module>
from ..operations import make_operation
../../../venv/py37/lib/python3.7/site-packages/connexion/operations/__init__.py:1: in <module>
from .abstract import AbstractOperation # noqa
../../../venv/py37/lib/python3.7/site-packages/connexion/operations/abstract.py:10: in <module>
from ..decorators.response import ResponseValidator
../../../venv/py37/lib/python3.7/site-packages/connexion/decorators/response.py:12: in <module>
from .validation import ResponseBodyValidator
../../../venv/py37/lib/python3.7/site-packages/connexion/decorators/validation.py:9: in <module>
from werkzeug import FileStorage
E ImportError: cannot import name 'FileStorage' from 'werkzeug'
Problem fixed doing:
pip uninstall Werkzeug connexion
pip install connexion==2.6.0
If you also want working tox
tests, apply this patch:
diff --git i/requirements.txt w/requirements.txt
index b5bc506..c44cfa7 100644
--- i/requirements.txt
+++ w/requirements.txt
@@ -1,3 +1,3 @@
-connexion == 2.2.0
+connexion == 2.7.0
python_dateutil == 2.6.0
setuptools >= 21.0.0
diff --git i/test-requirements.txt w/test-requirements.txt
index 7f8d96e..3bff640 100644
--- i/test-requirements.txt
+++ w/test-requirements.txt
@@ -1,4 +1,4 @@
-flask_testing==0.6.1
+flask_testing
coverage>=4.0.3
nose>=1.3.7
pluggy>=0.3.1
Still has the requirements.txt set to connexion == 2.2.0
I believe you must be using the 2.X branch.
Description
When I run flask-server, I get bellow ImportError.
Swagger-codegen version
2.4.13
Swagger declaration file content or url
https://petstore.swagger.io/v2/swagger.json
Command line used for generation
I generated flask server from swagger-editor.
Steps to reproduce
I use venv and run swagger_server
Related issues/PRs
https://github.com/zalando/connexion/issues/1149
Suggest a fix/enhancement
I can fix this bug when adding two line in reqirements.txt.