-
Notifications
You must be signed in to change notification settings - Fork 110
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
cannot import name 'cached_property' from 'werkzeug' #143
Comments
Same issue as: noirbizarre/flask-restplus#777 The proposed temporary solution is to pin |
I have created a fix for this #144 but CI infrastructure is not working Downloading archive: https://storage.googleapis.com/travis-ci-language-archives/python/binaries/ubuntu/16.04/x86_64/python-2.6.tar.bz2 |
Pin Werkzeug dependency to make sure unittests keep running while jarus/flask-testing#143 is still open.
Any updates regarding CI? |
Pin Werkzeug dependency to make sure unittests keep running while jarus/flask-testing#143 is still open.
Pin Werkzeug dependency to make sure unittests keep running while jarus/flask-testing#143 is still open.
for fix error escribled in jarus/flask-testing#143
As it is fixed. Could you release a new version? :) |
ImportError: cannot import name 'cached_property' from 'werkzeug' (C:\Users\BABA\PycharmProjects\Automation\venv\lib\site-packages\werkzeug_init_.py) I am getting this error message |
from flask import Flask app = Flask(name) @api.route('/language') if name == "main": |
the explicit requirement for werkzeug should be removed one this issue is fixed: jarus/flask-testing#143
the explicit requirement for werkzeug should be removed one this issue is fixed: jarus/flask-testing#143
I've fixed this with: |
Thanks! This works. |
fyi: this issue has been fixed in version |
Updating to Werkzeug==0.16.1 has fixed. |
…is github issue for more info jarus/flask-testing#143
Still happening when upgrading to 1.0.1 version |
Still happening as of today. |
Still broken with werkzeug==1.0.1 as of 4th Sept 2020 Can be fixed by adding
before importing flask_restplus |
Pin Werkzeug dependency to make sure unittests keep running while jarus/flask-testing#143 is still open.
Thanks @SidJain1412! User-side workaround when not expecting to call werkzeug directly: try:
from flask_restplus import Resource, Api
except ImportError:
import werkzeug
werkzeug.cached_property = werkzeug.utils.cached_property
from flask_restplus import Resource, Api |
This is still an issue. |
This is still an issue. ontology_1 | File "./get_title_details.py", line 1, in |
If I downgrade to Werkzeug==0.16.1 I get this other error: |
Werkzeug==2.0.1 With this requirements, the issue is still there, I downgraded to |
When I downgrade it says: flask 2.0.1 requires Werkzeug>=2.0, but you'll have werkzeug 0.16.1 which is incompatible.. Any suggestions? |
+1 Any ideas on how to resolve this? Haven't been able to solve the issue with the responses above and downgrading is not an option due to flask 2.0.1 not being compatible.
Traceback:
|
100%. I can't believe this is still going on. |
Yes
…On Tue, 13 Jul, 2021, 9:19 am toddman2, ***@***.***> wrote:
If I downgrade to Werkzeug==0.16.1 I get this other error:
from werkzeug.local import ContextVar
ImportError: cannot import name 'ContextVar' from 'werkzeug.local'
(/home/paula/venvs/bidlab-venv/lib/python3.8/site-packages/werkzeug/local.py)
100%. I can't believe this is still going on.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#143 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALR2PCSCNX3Y2TKMUKDSPDDTXOZWHANCNFSM4KRE6NPQ>
.
|
Maybe related: Switch locals to be based on ContextVars #1778 The storage attribute has been kept for backwards compatibility (even though it is a dunder it seems it is used, e.g. in tests). The ident_func though must be deprecated as this is now handled by the ContextVar. This may cause some backwards incompatibility. |
Is there a solution to this problem? |
The issue still persists as of today... temporary workaround: try:
from flask_restplus import Api, Resource
except ImportError:
import werkzeug, flask.scaffold
werkzeug.cached_property = werkzeug.utils.cached_property
flask.helpers._endpoint_from_view_func = flask.scaffold._endpoint_from_view_func
from flask_restplus import Api, Resource |
Current requirements.txt
and applied work around as (Downgrade is not possible due to compatibility)
Now the exception is coming
Not sure what i am missing here , does any one else also faced same issue |
We all should be migrating to flask-restx which is a wrapper for this library and it's been actively maintained. |
Clearly seems the owner is busy these days or no longer has an interest in fixing this. I'm cutting the guy some slack -- it's been a useful package so far. It would be appreciated if he could check in with us one way or another. Thanks for all your time you've put into so far. |
" The temporary solution isn't possible. "pin Werkzeug==0.16.1 until a proper fix is put in place." |
werkzeug just released 1.0.0, and the deprecated werkzeug.cached_property has been removed in favor of werkzeug.utils.cached_property.
This was addressed in October by pull request # 141, but it seems like it failed testing because the old python 3.3 and 2.6 couldn't be downloaded.
The text was updated successfully, but these errors were encountered: