Skip to content
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

_request_ctx_stack deprecated and no longer available in Flask >= 3 #263

Closed
carlostighe opened this issue Mar 1, 2024 · 2 comments
Closed

Comments

@carlostighe
Copy link

carlostighe commented Mar 1, 2024

Traceback (most recent call last):
  File "/home/carlos/sites/datapusher/datapusher/main.py", line 3, in <module>
    import ckanserviceprovider.web as web
  File "/home/carlos/sites/datapusher/venv/lib/python3.10/site-packages/ckanserviceprovider/web.py", line 13, in <module>
    import flask_login as flogin
  File "/home/carlos/sites/datapusher/venv/lib/python3.10/site-packages/flask_login/__init__.py", line 12, in <module>
    from .login_manager import LoginManager
  File "/home/carlos/sites/datapusher/venv/lib/python3.10/site-packages/flask_login/login_manager.py", line 5, in <module>
    from flask import _request_ctx_stack
ImportError: cannot import name '_request_ctx_stack' from 'flask' (/home/carlos/sites/datapusher/venv/lib/python3.10/site-packages/flask/__init__.py)

_request_ctx_stack has been deprecated and no is longer available in Flask >= 3

Flask and Flask-Login are dependencies of ckanserviceprovider

ckanserviceprovider==1.1.0
├── APScheduler [required: >=2.1.2,<3.10.0, installed: 3.9.1.post1]
│   ├── pytz [required: Any, installed: 2024.1]
│   ├── setuptools [required: >=0.7, installed: 65.5.0]
│   ├── six [required: >=1.4.0, installed: 1.16.0]
│   └── tzlocal [required: >=2.0,!=3.*, installed: 5.2]
├── flask [required: >=1.1.1, installed: 3.0.2]
│   ├── blinker [required: >=1.6.2, installed: 1.7.0]
│   ├── click [required: >=8.1.3, installed: 8.1.7]
│   ├── itsdangerous [required: >=2.1.2, installed: 2.1.2]
│   ├── Jinja2 [required: >=3.1.2, installed: 3.1.3]
│   │   └── MarkupSafe [required: >=2.0, installed: 2.1.5]
│   └── werkzeug [required: >=3.0.0, installed: 3.0.1]
│       └── MarkupSafe [required: >=2.1.1, installed: 2.1.5]
├── Flask-Login [required: ==0.6.0, installed: 0.6.0]
│   ├── flask [required: >=1.0.4, installed: 3.0.2]
│   │   ├── blinker [required: >=1.6.2, installed: 1.7.0]
│   │   ├── click [required: >=8.1.3, installed: 8.1.7]
│   │   ├── itsdangerous [required: >=2.1.2, installed: 2.1.2]
│   │   ├── Jinja2 [required: >=3.1.2, installed: 3.1.3]
│   │   │   └── MarkupSafe [required: >=2.0, installed: 2.1.5]
│   │   └── werkzeug [required: >=3.0.0, installed: 3.0.1]
│   │       └── MarkupSafe [required: >=2.1.1, installed: 2.1.5]
│   └── werkzeug [required: >=1.0.1, installed: 3.0.1]
│       └── MarkupSafe [required: >=2.1.1, installed: 2.1.5]
├── future [required: Any, installed: 1.0.0]
├── requests [required: >=2.23.0, installed: 2.27.1]
│   ├── certifi [required: >=2017.4.17, installed: 2024.2.2]
│   ├── charset-normalizer [required: ~=2.0.0, installed: 2.0.12]
│   ├── idna [required: >=2.5,<4, installed: 3.6]
│   └── urllib3 [required: >=1.21.1,<1.27, installed: 1.26.18]
├── SQLAlchemy [required: >=1.3.15,<1.4.0, installed: 1.3.24]
└── werkzeug [required: >=1.0.0, installed: 3.0.1]
    └── MarkupSafe [required: >=2.1.1, installed: 2.1.5]

Updating ckanserviceprovider from 1.1.0 to 1.2.0 fixed this issue but caused issues with messytables
See this issue here - okfn/messytables#199

@carlostighe
Copy link
Author

Similar issue with html5lib

Update to html5lib==1.1 to solve its issue

@amercader
Copy link
Member

Thanks @carlostighe, this should be fixed in datapusher 0.0.21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants