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

Can't Import Holoviews #5244

Closed
BrandonSLockey opened this issue Mar 24, 2022 · 7 comments
Closed

Can't Import Holoviews #5244

BrandonSLockey opened this issue Mar 24, 2022 · 7 comments

Comments

@BrandonSLockey
Copy link

ALL software version info

(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc)

Description of expected behavior and the observed behavior

Im trying to install holoviews for UMAP

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

import holoviews as hv

Stack traceback and/or browser JavaScript console output

import holoviews as hv
Traceback (most recent call last):

File "C:\Users\brand\AppData\Local\Temp/ipykernel_1540/4081495914.py", line 1, in
import holoviews as hv

File "C:\Users\brand\anaconda3\envs\SALIB\lib\site-packages\holoviews_init_.py", line 12, in
from .annotators import annotate # noqa (API import)

File "C:\Users\brand\anaconda3\envs\SALIB\lib\site-packages\holoviews\annotators.py", line 10, in
from panel.pane import PaneBase

File "C:\Users\brand\anaconda3\envs\SALIB\lib\site-packages\panel_init_.py", line 1, in
from . import layout # noqa

File "C:\Users\brand\anaconda3\envs\SALIB\lib\site-packages\panel\layout_init_.py", line 1, in
from .accordion import Accordion # noqa

File "C:\Users\brand\anaconda3\envs\SALIB\lib\site-packages\panel\layout\accordion.py", line 5, in
from .base import NamedListPanel

File "C:\Users\brand\anaconda3\envs\SALIB\lib\site-packages\panel\layout\base.py", line 13, in
from ..reactive import Reactive

File "C:\Users\brand\anaconda3\envs\SALIB\lib\site-packages\panel\reactive.py", line 26, in
from .config import config

File "C:\Users\brand\anaconda3\envs\SALIB\lib\site-packages\panel\config.py", line 21, in
from .io.notebook import load_notebook

File "C:\Users\brand\anaconda3\envs\SALIB\lib\site-packages\panel\io_init_.py", line 9, in
from ..config import config

ImportError: cannot import name 'config' from partially initialized module 'panel.config' (most likely due to a circular import) (C:\Users\brand\anaconda3\envs\SALIB\lib\site-packages\panel\config.py)

Screenshots or screencasts of the bug in action

cannot import name 'config' from partially initialized module 'panel.config' (most likely due to a circular import)

image

@MichaelGiazi
Copy link

MichaelGiazi commented Mar 24, 2022

I have a similar (?) issue trying to import the package in a fresh pipenv (from PyPI):

>>> import holoviews

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mg/.local/share/virtualenvs/hvTest-xxMFZooO/lib/python3.9/site-packages/holoviews/__init__.py", line 12, in <module>
    from .annotators import annotate                         # noqa (API import)
  File "/home/mg/.local/share/virtualenvs/hvTest-xxMFZooO/lib/python3.9/site-packages/holoviews/annotators.py", line 10, in <module>
    from panel.pane import PaneBase
  File "/home/mg/.local/share/virtualenvs/hvTest-xxMFZooO/lib/python3.9/site-packages/panel/__init__.py", line 1, in <module>
    from . import layout # noqa
  File "/home/mg/.local/share/virtualenvs/hvTest-xxMFZooO/lib/python3.9/site-packages/panel/layout/__init__.py", line 1, in <module>
    from .accordion import Accordion # noqa
  File "/home/mg/.local/share/virtualenvs/hvTest-xxMFZooO/lib/python3.9/site-packages/panel/layout/accordion.py", line 5, in <module>
    from .base import NamedListPanel
  File "/home/mg/.local/share/virtualenvs/hvTest-xxMFZooO/lib/python3.9/site-packages/panel/layout/base.py", line 11, in <module>
    from ..io.model import hold
  File "/home/mg/.local/share/virtualenvs/hvTest-xxMFZooO/lib/python3.9/site-packages/panel/io/__init__.py", line 9, in <module>
    from ..config import config
  File "/home/mg/.local/share/virtualenvs/hvTest-xxMFZooO/lib/python3.9/site-packages/panel/config.py", line 21, in <module>
    from .io.notebook import load_notebook
  File "/home/mg/.local/share/virtualenvs/hvTest-xxMFZooO/lib/python3.9/site-packages/panel/io/notebook.py", line 39, in <module>
    from .resources import Bundle, Resources, _env, bundle_resources
  File "/home/mg/.local/share/virtualenvs/hvTest-xxMFZooO/lib/python3.9/site-packages/panel/io/resources.py", line 24, in <module>
    from jinja2 import Environment, Markup, FileSystemLoader
ImportError: cannot import name 'Markup' from 'jinja2' (/home/mg/.local/share/virtualenvs/hvTest-xxMFZooO/lib/python3.9/site-packages/jinja2/__init__.py)

@philippjfr
Copy link
Member

Thanks you two!

@BrandonSLockey Could you report panel and holoviews versions?

@MichaelGiazi How did you install holoviews? Can you install jinja2?

@MichaelGiazi
Copy link

@philippjfr

Yes, it was jinja2, this fails:

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[packages]
jinja2 = "==3.1.0"
holoviews = "==1.14.8"

but using jinja2 = "==3.0.2" worked correctly. Jinja2 was updated yesterday evening turns out.

@wimiko
Copy link

wimiko commented Mar 25, 2022

from the Jinja2 3.1.0 releasenotes:

Markup and escape should be imported from MarkupSafe.

Seems that markup is not provided by jinja2 anymore and should be imported from markupsafe:

from markupsafe import Markup

@philippjfr
Copy link
Member

Fixed in holoviz/panel#3258. There's now also a 0.13.0a46 dev release available with the fix. Hope to have a real release out very soon.

edeno added a commit to LorenFrankLab/spyglass that referenced this issue Mar 25, 2022
edeno added a commit to LorenFrankLab/spyglass that referenced this issue Mar 25, 2022
edeno added a commit to LorenFrankLab/spyglass that referenced this issue Mar 25, 2022
@philippjfr
Copy link
Member

Panel 0.12.7 is now available on PyPI and from the conda pyviz and conda-forge channels.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants