snehilvj / async-dash

Async port of the official Plotly Dash library
https://snehilvj.medium.com/introducing-asynchronous-dash-87147555a28a
38 stars 4 forks source link

ImportError: cannot import name 'escape' from 'jinja2' #3

Open LasseRegin opened 1 year ago

LasseRegin commented 1 year ago

Simply importing async-dash causes following error:

from async_dash import Dash

Error:

Traceback (most recent call last):
  File "/Users/lassereginnielsen/Workspace/woodsense/code/admin-dashboard/run_locally.py", line 1, in <module>
    from app import app
  File "/Users/lassereginnielsen/Workspace/woodsense/code/admin-dashboard/app/__init__.py", line 1, in <module>
    from app.main import app
  File "/Users/lassereginnielsen/Workspace/woodsense/code/admin-dashboard/app/main.py", line 3, in <module>
    from app.dash_app import app
  File "/Users/lassereginnielsen/Workspace/woodsense/code/admin-dashboard/app/dash_app.py", line 2, in <module>
    from async_dash import Dash
  File "/Users/lassereginnielsen/Workspace/woodsense/code/admin-dashboard/venv/lib/python3.10/site-packages/async_dash/__init__.py", line 1, in <module>
    from async_dash import (
  File "/Users/lassereginnielsen/Workspace/woodsense/code/admin-dashboard/venv/lib/python3.10/site-packages/async_dash/monkey_patch_callback_context.py", line 2, in <module>
    import quart
  File "/Users/lassereginnielsen/Workspace/woodsense/code/admin-dashboard/venv/lib/python3.10/site-packages/quart/__init__.py", line 3, in <module>
    from jinja2 import escape, Markup
ImportError: cannot import name 'escape' from 'jinja2' (/Users/lassereginnielsen/Workspace/woodsense/code/admin-dashboard/venv/lib/python3.10/site-packages/jinja2/__init__.py)

Output of pip freeze:

aiofiles==23.1.0
aioflask==0.4.0
asgiref==3.7.2
async-dash==0.1.0a1
async-lru==1.0.2
asyncio==3.4.3
asyncpg==0.26.0
black==22.12.0
blinker==1.6.2
Brotli==1.0.9
bson==0.5.10
cachelib==0.10.0
cachetools==5.2.1
certifi==2022.12.7
charset-normalizer==3.0.1
chart-studio==1.1.0
click==8.1.3
dash==2.10.2
dash-auth==1.4.1
dash-bootstrap-components==1.4.1
dash-core-components==2.0.0
dash-html-components==2.0.0
dash-table==5.0.0
databases==0.6.1
dnspython==2.3.0
email-validator==1.3.0
Flask==2.2.2
Flask-Caching==2.0.1
Flask-Compress==1.13
Flask-SeaSurf==1.1.1
google-api-core==2.11.0
google-auth==2.16.0
google-cloud-core==2.3.2
google-cloud-storage==2.7.0
google-cloud-tasks==2.12.0
google-crc32c==1.5.0
google-resumable-media==2.4.0
googleapis-common-protos==1.58.0
greenlet==2.0.2
greenletio==0.10.1
grpc-google-iam-v1==0.12.6
grpcio==1.51.1
grpcio-status==1.51.1
gunicorn==20.1.0
h11==0.14.0
h2==4.1.0
hpack==4.0.0
hypercorn==0.14.3
hyperframe==6.0.1
idna==3.4
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.2
mypy-extensions==0.4.3
nodeenv==1.8.0
numpy==1.24.1
orjson==3.8.5
ormar==0.12.2
pandas==1.5.2
pathspec==0.10.3
platformdirs==2.6.2
plotly==5.12.0
priority==2.0.0
proto-plus==1.22.2
protobuf==4.21.12
psycopg2-binary==2.9.5
pyasn1==0.4.8
pyasn1-modules==0.2.8
pydantic==1.10.2
pyright==1.1.315
python-dateutil==2.8.2
pytz==2022.7.1
quart==0.16.3
requests==2.28.2
retrying==1.3.4
rsa==4.9
six==1.16.0
SQLAlchemy==1.4.41
tenacity==8.1.0
toml==0.10.2
tomli==2.0.1
typing_extensions==4.4.0
ua-parser==0.16.1
urllib3==1.26.14
uvicorn==0.22.0
Werkzeug==2.2.2
wsproto==1.2.0
darkjhesus commented 1 year ago

¿Did you find some solution?

NiklasLue commented 1 year ago

You can upgrade quart manually to 0.18.4. Even though pip will give you a warning, everything is working fine for me.