Skip to content

ImportError occurs with Werkzeug 2.2.2 #468

Closed
@bichanna

Description

@bichanna

Code

from flask import Flask
from flask_restx import Api

app = Flask(__name__)
api = Api(app)

Repro Steps (if applicable)

  1. Run flask run

Expected Behavior

Nothing bad happens, and the development server should start.

Error Messages/Stack Trace

Traceback (most recent call last):
  File "/usr/local/bin/hy", line 8, in <module>
    sys.exit(hy_main())
  File "/usr/local/lib/python3.10/runpy.py", line 289, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/usr/local/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "shim.py", line 3, in <module>
    from api import app
  File "/app/testapp/src/api/__init__.py", line 5, in <module>
    from flask_restx import Api
  File "/usr/local/lib/python3.10/site-packages/flask_restx/__init__.py", line 5, in <module>
    from .api import Api  # noqa
  File "/usr/local/lib/python3.10/site-packages/flask_restx/api.py", line 50, in <module>
    from .swagger import Swagger
  File "/usr/local/lib/python3.10/site-packages/flask_restx/swagger.py", line 18, in <module>
    from werkzeug.routing import parse_rule
ImportError: cannot import name 'parse_rule' from 'werkzeug.routing' (/usr/local/lib/python3.10/site-packages/werkzeug/routing/__init__.py)

Environment

  • Python version: python 3.10.6
  • Flask version: 2.2.2
  • Werkzeug version: 2.2.2
  • Flask-RESTX version: 0.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions