Skip to content

Werkzeug ImportError #61

@abdounasser202

Description

@abdounasser202

Got an ImportError on ../flask_restx/api.py

Code

from werkzeug import cached_property

Expected Behavior

cached_property is not longer located in werkzeug for werkzeug 1.0.0

Actual Behavior

cached_property is located in werkzeug.utils for werkzeug 1.0.0

Error Messages/Stack Trace

Error: While importing "run", an ImportError was raised:

Traceback (most recent call last):
  File "/home/nasser/.local/lib/python3.6/site-packages/flask/cli.py", line 240, in locate_app
    __import__(module_name)
  File "/home/nasser/me/cs/IslamApp/run.py", line 3, in <module>
    from application import app
  File "/home/nasser/me/cs/IslamApp/application/__init__.py", line 51, in <module>
    module = importlib.import_module(plugin['path'], package='application')
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/nasser/me/cs/IslamApp/application/api/__init__.py", line 4, in <module>
    from flask_restx import Api
  File "/home/nasser/.local/lib/python3.6/site-packages/flask_restx/__init__.py", line 5, in <module>
    from .api import Api  # noqa
  File "/home/nasser/.local/lib/python3.6/site-packages/flask_restx/api.py", line 28, in <module>
    from werkzeug import cached_property
ImportError: cannot import name 'cached_property'

Environment

  • Python 3.6.9
  • Flask 1.1.1
  • Flask-RESTX 0.1.1
  • flask-sqlalchemy 2.4.1
  • flask-debugtoolbar 0.10.1
  • flask-login 0.5.0
  • flask-migrate 2.5.2
  • flask-wtf 0.14.3

Additional Context

I think it's good to release a version for werkzeug 1.0.0 since it has been release 2020-02-06
This is the blogpost about https://www.palletsprojects.com/blog/werkzeug-1-0-0-released/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions