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

Import error can't import name 'Markup' from 'jinja2' #83

Open
wh9700 opened this issue Mar 30, 2022 · 10 comments
Open

Import error can't import name 'Markup' from 'jinja2' #83

wh9700 opened this issue Mar 30, 2022 · 10 comments

Comments

@wh9700
Copy link

wh9700 commented Mar 30, 2022

Hi @albsantosdel

after docker run -d --name ckgapp -p 7474:7474 -p 7687:7687 -p 8090:8090 -p 8050:8050 docker-ckg:latest

cannot import name 'Markup' from 'jinja2' (/usr/local/lib/python3.7/site-packages/jinja2/init.py)

the docker logs

图片

@wh9700
Copy link
Author

wh9700 commented Apr 4, 2022

somebody help me

@wh9700 wh9700 changed the title celery error:Invalid value for '-A' / '--app' Import error can't import name 'Markup' from 'jinja2' Apr 5, 2022
@Meadunce
Copy link

Meadunce commented Apr 7, 2022

In a closed issue someone proposed a solution ,but now it seems doesn‘t work . ???

@wh9700
Copy link
Author

wh9700 commented Apr 10, 2022 via email

@rodguinea
Copy link

Hi, did someone figure out the solution for this problem?

@kamms
Copy link

kamms commented Apr 28, 2022

updating a few python packages fixed this issue for me. Execute
pip install --upgrade Flask werkzeug==2.0.3
in the container's shell.

@roivant-matts
Copy link

This can be resolved before building the image by adjusting the following in the requirements.txt:
Update:
Flask==2.0.3

Add:
Werkzeug==2.0.3

Remove:
itsdangerous==2.0.1

@wh9700
Copy link
Author

wh9700 commented Oct 11, 2022 via email

@Mnikley
Copy link

Mnikley commented Nov 20, 2023

What worked for me (applied to the docker image):

docker exec -it ckgapp bash

pip uninstall -y jinja2 werkzeug pingouin pandas importlib-metadata
pip install jinja2==3.0.3 werkzeug==2.0.3 pingouin==0.3.12 pandas==0.24.0 importlib-metadata==4.13.0
exit

docker stop ckgapp && docker start ckgapp

@bolak92
Copy link

bolak92 commented Apr 3, 2024

@Mnikley did you also update Flask before that?

@Mnikley
Copy link

Mnikley commented Apr 22, 2024

Sorry for the late response. Unfortunately I cannot make the container work at the moment and I dont have time to recreate everything from scratch. However, maybe this helps you get on your way regarding the specific Flask issue:

docker exec -it ckgapp bash
python3
>>> from jinja2 import Markup
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Markup' from 'jinja2' (/usr/local/lib/python3.7/site-packages/jinja2/__init__.py)
>>> quit()

to fix it:

docker exec -it ckgapp bash
pip uninstall -y jinja2 werkzeug pingouin pandas importlib-metadata
pip install jinja2==3.0.3 werkzeug==2.0.3 pingouin==0.3.12 pandas==0.24.0 importlib-metadata==4.13.0
python3
>>> from jinja2 import Markup
>>> quit()

and you will get no error. this is the full Python environment my container uses:

docker exec ckgapp2 pip list                                                                                                                                                  ─╯
Package                       Version
----------------------------- ------------
alabaster                     0.7.13
alembic                       1.12.1
amqp                          5.2.0
anyio                         3.7.1
appdirs                       1.4.4
argon2-cffi                   23.1.0
argon2-cffi-bindings          21.2.0
async-generator               1.10
async-timeout                 4.0.3
attrs                         23.1.0
autograd                      1.6.2
autograd-gamma                0.5.0
Babel                         2.13.1
backcall                      0.2.0
bcrypt                        3.1.7
beautifulsoup4                4.7.1
billiard                      3.6.4.0
biopython                     1.73
bioservices                   1.11.2
bleach                        6.0.0
Brotli                        1.1.0
cached-property               1.5.2
cattrs                        23.1.2
celery                        5.0.5
certifi                       2023.7.22
certipy                       0.1.3
cffi                          1.15.1
chardet                       3.0.4
chart-studio                  1.0.0
click                         7.1.2
click-didyoumean              0.3.0
click-plugins                 1.1.1
click-repl                    0.3.0
colorama                      0.4.6
colorlog                      6.7.0
combat                        0.2.0
comm                          0.1.4
cryptography                  41.0.5
cvxpy                         1.1.7
cycler                        0.11.0
cyjupyter                     0.2.0
dash                          1.2.0
dash-core-components          1.1.2
dash-cytoscape                0.3.0
dash-html-components          1.0.1
dash-renderer                 1.0.1
dash-table                    4.2.0
debugpy                       1.7.0
decorator                     5.1.1
defusedxml                    0.7.1
dnspython                     2.3.0
docutils                      0.15.2
easydev                       0.12.1
ecos                          2.0.12
entrypoints                   0.4
et-xmlfile                    1.1.0
eventlet                      0.25.1
exceptiongroup                1.1.3
fastjsonschema                2.18.1
Flask                         1.0.3
Flask-Compress                1.14
fonttools                     4.38.0
future                        0.18.3
gevent                        22.10.2
greenlet                      3.0.1
grequests                     0.7.0
gseapy                        0.9.19
h5py                          2.10.0
html5lib                      1.1
idna                          2.8
imagesize                     1.4.1
importlib-metadata            4.13.0
importlib-resources           5.12.0
iniconfig                     2.0.0
ipykernel                     6.16.2
ipython                       7.34.0
ipython-genutils              0.2.0
ipywidgets                    8.1.1
itsdangerous                  2.0.1
jdcal                         1.4.1
jedi                          0.19.1
Jinja2                        3.0.3
joblib                        1.3.2
jsonschema                    4.17.3
jupyter                       1.0.0
jupyter_client                7.4.9
jupyter-console               6.6.3
jupyter_core                  4.12.0
jupyter-server                1.24.0
jupyter-telemetry             0.1.0
jupyterhub                    4.0.2
jupyterlab-pygments           0.2.2
jupyterlab-widgets            3.0.9
kaleido                       0.0.1
kiwisolver                    1.4.5
kmapper                       1.2.0
kombu                         5.2.4
lifelines                     0.23.1
littleutils                   0.2.2
llvmlite                      0.39.1
lxml                          4.3.4
Mako                          1.2.4
MarkupSafe                    2.1.3
matplotlib                    3.5.3
matplotlib-inline             0.1.6
mistune                       3.0.2
monotonic                     1.6
mpmath                        1.2.1
natsort                       6.0.0
nbclassic                     1.0.0
nbclient                      0.7.4
nbconvert                     7.6.0
nbformat                      5.8.0
nbsphinx                      0.9.3
neo4j                         4.2.0
nest-asyncio                  1.5.8
networkx                      2.5
nltk                          3.5
notebook                      6.5.6
notebook_shim                 0.2.3
numba                         0.56.4
numexpr                       2.8.6
numpy                         1.19.5
oauthlib                      3.2.2
obonet                        0.2.5
openpyxl                      3.0.1
osqp                          0.6.3
outdated                      0.2.2
packaging                     23.2
pamela                        1.1.0
pandas                        0.24.0
pandas-flavor                 0.6.0
pandocfilters                 1.5.0
parso                         0.8.3
passlib                       1.7.1
patsy                         0.5.3
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        9.5.0
pingouin                      0.3.12
pip                           23.3.1
pkgutil_resolve_name          1.3.10
platformdirs                  3.11.0
plotly                        4.9.0
pluggy                        1.2.0
prometheus-client             0.17.1
prompt-toolkit                3.0.39
psutil                        5.9.6
ptyprocess                    0.7.0
pycparser                     2.21
Pygments                      2.16.1
pynndescent                   0.5.10
pyOpenSSL                     23.3.0
pyparsing                     3.1.1
PyPDF2                        3.0.1
pyrsistent                    0.19.3
pytest                        7.4.3
python-dateutil               2.8.2
python-json-logger            2.0.7
python-louvain                0.13
pytz                          2023.3.post1
pyvis                         0.1.7.0
PyYAML                        5.1.1
pyzmq                         24.0.1
qdldl                         0.1.7.post0
qtconsole                     5.4.4
QtPy                          2.4.1
rarfile                       3.1
redis                         5.0.1
regex                         2023.10.3
reportlab                     3.6.6
requests                      2.22.0
requests-cache                1.1.0
retrying                      1.3.4
rpy2                          3.0.5
rst2pdf                       0.98
ruamel.yaml                   0.18.5
ruamel.yaml.clib              0.2.8
scikit-learn                  1.0.2
scipy                         1.4.1
scs                           3.2.3
seaborn                       0.11.2
Send2Trash                    1.8.2
setuptools                    47.1.0
simplegeneric                 0.8.1
six                           1.16.0
sklearn                       0.0
smartypants                   2.0.1
snfpy                         0.2.2
sniffio                       1.3.0
snowballstemmer               2.2.0
soupsieve                     2.4.1
Sphinx                        2.3.1
sphinxcontrib-applehelp       1.0.2
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.5
SQLAlchemy                    2.0.23
statsmodels                   0.10.0
suds-community                1.1.2
tables                        3.6.1
tabulate                      0.9.0
tbb                           2021.10.0
terminado                     0.17.1
threadpoolctl                 3.1.0
tinycss2                      1.2.1
tomli                         2.0.1
tornado                       6.2
tqdm                          4.66.1
traitlets                     5.9.0
typing_extensions             4.7.1
tzlocal                       1.5.1
umap-learn                    0.5.4
url-normalize                 1.4.3
urllib3                       1.25.11
uWSGI                         2.0.23
vine                          5.1.0
wcwidth                       0.2.9
webencodings                  0.5.1
websocket-client              1.6.1
webweb                        0.0.37
Werkzeug                      2.0.3
wget                          3.2
wheel                         0.41.3
widgetsnbextension            4.0.9
wordcloud                     1.8.1
wrapt                         1.15.0
xarray                        0.14.1
xhtml2pdf                     0.2.4
xlrd                          1.2.0
xmltodict                     0.13.0
zipp                          3.15.0
zope.event                    5.0
zope.interface                6.1

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

7 participants