alphamap
alphamap copied to clipboard
cannot import name 'Markup' from 'jinja2'
Hello,
I installed alphamap via pip in a separate conda environment. When i try to run alphamap, i run into an import error from Jinja2 package:
(alphamap) $ alphamap
Traceback (most recent call last):
File "/home/momi/miniconda3/envs/alphamap/bin/alphamap", line 33, in <module>
sys.exit(load_entry_point('alphamap', 'console_scripts', 'alphamap')())
File "/home/momi/miniconda3/envs/alphamap/bin/alphamap", line 25, in importlib_load_entry_point
return next(matches).load()
File "/home/momi/miniconda3/envs/alphamap/lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/home/momi/miniconda3/envs/alphamap/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/momi/tools/alphamap/alphamap/gui.py", line 15, in <module>
import panel as pn
File "/home/momi/miniconda3/envs/alphamap/lib/python3.8/site-packages/panel/__init__.py", line 3, in <module>
from . import layout # noqa
File "/home/momi/miniconda3/envs/alphamap/lib/python3.8/site-packages/panel/layout/__init__.py", line 1, in <module>
from .accordion import Accordion # noqa
File "/home/momi/miniconda3/envs/alphamap/lib/python3.8/site-packages/panel/layout/accordion.py", line 5, in <module>
from .base import NamedListPanel
File "/home/momi/miniconda3/envs/alphamap/lib/python3.8/site-packages/panel/layout/base.py", line 13, in <module>
from ..io.model import hold
File "/home/momi/miniconda3/envs/alphamap/lib/python3.8/site-packages/panel/io/__init__.py", line 8, in <module>
from ..config import config
File "/home/momi/miniconda3/envs/alphamap/lib/python3.8/site-packages/panel/config.py", line 20, in <module>
from .io.notebook import load_notebook
File "/home/momi/miniconda3/envs/alphamap/lib/python3.8/site-packages/panel/io/notebook.py", line 16, in <module>
import bokeh.embed.notebook
File "/home/momi/miniconda3/envs/alphamap/lib/python3.8/site-packages/bokeh/embed/__init__.py", line 23, in <module>
from .server import server_document, server_session
File "/home/momi/miniconda3/envs/alphamap/lib/python3.8/site-packages/bokeh/embed/server.py", line 25, in <module>
from ..core.templates import AUTOLOAD_REQUEST_TAG, FILE
File "/home/momi/miniconda3/envs/alphamap/lib/python3.8/site-packages/bokeh/core/templates.py", line 42, in <module>
from jinja2 import Environment, FileSystemLoader, Markup
ImportError: cannot import name 'Markup' from 'jinja2' (/home/momi/miniconda3/envs/alphamap/lib/python3.8/site-packages/jinja2/__init__.py)
I read that Markup is no longer supported on Jinja2. Could you advise on how to solve the issue?
Flask and Jinja2 versions:
Successfully installed Flask-2.3.3 Jinja2-3.1.2 Werkzeug-2.3.7 blinker-1.6.2 click-8.1.7 itsdangerous-2.1.2
I was able to run alphamap by fixing the versions of jinja2 and markupsafe:
pip install alphamap jinja2==2.11.3 markupsafe==1.1.1
Thanks a lot for your comments - we just released a new alphamap version which should address this issue. Please let us know in case the problem persists