pallets-eco / flask-admin

Simple and extensible administrative interface framework for Flask
BSD 3-Clause "New" or "Revised" License
5.69k stars 1.56k forks source link

Error launching the examples using Python 3.12 #2413

Open eharvey71 opened 4 months ago

eharvey71 commented 4 months ago

I followed the instructions for cloning the repo and running the examples in my local environment. I'm using the latest stable python (3.12). I'm getting this error when attempting to launch run_server.py in examples:

ImportError: cannot import name '_request_ctx_stack' from 'flask' (/Users/project/dev/flask-admin/venv/lib/python3.12/site-packages/flask/__init__.py)

What do I need to do differently? I'm sensing that I need to be on Python 2, based on some of what I'm reading but the requirements aren't clear. I saw somewhere that Python 3.6 or higher is being worked on? Please be clear in your docs about minimum requirements, if this is the problem.

akgnah commented 4 months ago

Example sqla relies on an older project Flask-BabelEx, which relies on a feature _request_ctx_stack that was removed in Flask v2.3.

If you want to see the effect of examplesqla, you can change the Flask version in examples/sqla/requirements.txt first, and then run pip install -r examples/sqla/requirements.txt

$ cat examples/sqla/requirements.txt 
Flask<2.3.0
Flask-Admin
Flask-BabelEx
Flask-SQLAlchemy
tablib
enum34; python_version < '3.0'
sqlalchemy_utils
arrow
colour
email_validator

# note: for local development, replace 'Flask-Admin' above with a reference to
# your local copy of the repo e.g. '-e .' if you're installing this from the
# repo's root directory
$