skip to Main Content

When I am running a flask app with celery and redis, an importerror in appearing on the command prompt screen.
ImportError: cannot import name ‘_request_ctx_stack’ from ‘flask

I updated the versions of all dependencies, but still the issue persist. Could someone help me please to solve this error and why is this error occurring?

2

Answers


  1. ‘_request_ctx_stack’ is deprecated and was removed in Flask 2.3. Chances are high that some of the packages you are relying on make use of it. Downgrading to a lower version may fix the issue. Flask versions >= 2.2 or lower may work fine.

    Login or Signup to reply.
  2. If you are using flask_opentracing, it made use of this deprecated private name. The latest (and last) 2.0.0 version of flask_opentracing fixes this. flask_login also fixed this in a recent release.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search