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

jinja2 Markup import has changed #3257

Closed
IainHammond opened this issue Mar 25, 2022 · 4 comments · Fixed by #3258
Closed

jinja2 Markup import has changed #3257

IainHammond opened this issue Mar 25, 2022 · 4 comments · Fixed by #3258

Comments

@IainHammond
Copy link

IainHammond commented Mar 25, 2022

ALL software version info

Python 3.7.11 and panel 0.12.1

Description of expected behavior and the observed behavior

jinja2 updated on 24th March 2022 and the Markup import must be imported from markupmafe

Complete, minimal, self-contained example code that reproduces the issue

io/resources.py line 24

from jinja2 import Environment, Markup, FileSystemLoader

Suggest changing this to:
from jinja2 import Environment, FileSystemLoader
from markupsafe import Markup

Screenshots or screencasts of the bug in action

Screen Shot 2022-03-25 at 11 38 12 am

@akaszynski
Copy link

akaszynski commented Mar 25, 2022

Just noticed this issue as well in pyvista builds, which use on panel for documentation.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pv/lib/python3.8/site-packages/panel/__init__.py", line 1, in <module>
    from . import layout # noqa
  File "/tmp/pv/lib/python3.8/site-packages/panel/layout/__init__.py", line 1, in <module>
    from .accordion import Accordion # noqa
  File "/tmp/pv/lib/python3.8/site-packages/panel/layout/accordion.py", line 5, in <module>
    from .base import NamedListPanel
  File "/tmp/pv/lib/python3.8/site-packages/panel/layout/base.py", line 11, in <module>
    from ..io.model import hold
  File "/tmp/pv/lib/python3.8/site-packages/panel/io/__init__.py", line 9, in <module>
    from ..config import config
  File "/tmp/pv/lib/python3.8/site-packages/panel/config.py", line 21, in <module>
    from .io.notebook import load_notebook
  File "/tmp/pv/lib/python3.8/site-packages/panel/io/notebook.py", line 39, in <module>
    from .resources import Bundle, Resources, _env, bundle_resources
  File "/tmp/pv/lib/python3.8/site-packages/panel/io/resources.py", line 24, in <module>
    from jinja2 import Environment, Markup, FileSystemLoader
ImportError: cannot import name 'Markup' from 'jinja2' (/tmp/pv/lib/python3.8/site-packages/jinja2/__init__.py)

Pertinent packages:

$ pip list | grep "Jin\|panel"
panel                         0.12.6
Jinja2                        3.1.0

@celliern
Copy link

Same error on an internal project : current workaround was to explicitely pin the Jinja2 requirements

@MarcSkovMadsen
Copy link
Collaborator

Just experienced this too. My site awesome-panel.org failed deployment

image

image

@philippjfr
Copy link
Member

Yeah may just have to push out a 0.12.7 release before the 0.13 release next week.

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

Successfully merging a pull request may close this issue.

5 participants