Django Version 4: "import holoviews as hv" in django view causing error

Hi Community,

import holoviews as hv
from holoviews import opts, dim
from holoviews.streams import Pipe, Buffer
from holoviews.plotting.bokeh.styles import (line_properties, fill_properties, text_properties)
from holoviews.operation.timeseries import rolling, rolling_outlier_std

import panel as pn

The above imports in previous Django versions were working fine for me until when I upgraded to Django 4.

I am guessing that this issue had already been encountered and discussed. Please point me to discussed solutions.

Much appreciated.

Bokeh does not support Django 4, right now. I think the latest supported version is 3.1, maybe 3.2.

There is some ongoing development to support Django 4 and moving it out of Bokeh into a separate repository. Though, there is no ETA on when this will be available.

@Hoxbro thank you :+1:

1 Like

downgrading to Django-3.2.13 workarounds the issue, but Panel team is willing to apply a quick fix Panel tries to use unexpectedly Django, while executing in Jupyterlab · Issue #3484 · holoviz/panel · GitHub