Skip to content

ImportError occurs with Werkzeug 2.2.2 #468

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

Closed
bichanna opened this issue Aug 21, 2022 · 2 comments
Closed

ImportError occurs with Werkzeug 2.2.2 #468

bichanna opened this issue Aug 21, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@bichanna
Copy link

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
@bichanna bichanna added the bug Something isn't working label Aug 21, 2022
@safe
Copy link

safe commented Aug 21, 2022

This is being tracked via #460, could you close this issue and subscribe to this.

@bichanna
Copy link
Author

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants