Plots and PlotlyKaleido version mismatch when using PlutoSliderServer (v0.3.28)

I am publishing my notebooks using PlutoSliderServer with this .gitlab-ci.yml script. It is strange that locally the notebook renders just fine but the published notebook gives a warning PlotlyKaleido 2.2.2 is not compatible with this version of Plots. The declared compatibility is 1.: see the page.

The plot is rendered ok but I’d like to get rid of the warning, how to accomplish that? What is different between CI and local environments, both are using the same Julia version (1.10)?

I bumped up the PlutoSliderServer version to (really) v0.3.28, did not have an effect to the warning.

It seems like the warning should be there considering that Plots@v1.40.1 declares compatibility only with version 1 of PlotlyKaleido in the Project.toml

It is more interesting why you would not see in the local notebook.

I do see the warning locally, and once you see it you could make the cell hide the log with the relevant button:

If that is sufficent for you, you could manually add the metadata to the cell to hide the logs, see the code example below for specifying that a cell should hide logs:

# ╔═╡ c06bc487-113b-47d0-875f-787bdab3eda2
# ╠═╡ show_logs = false
plotly()

Are you actually gonna use PlotlyKaleido later in the notebook for saving pictures to file?

I started Pluto from a temporary environment and the warning appeared. It seems that Pluto environment is inheriting versions from the REPL where it is started.

Thanks for the hint about hide logs, I haven’t noticed it.

I do not need PlotlyKaleido but if I omit it I get an error:

Thanks!

Aha, I

begin
import Pkg
Pkg.update()
end

in a cell, then removed the cell and rerun the cell containing plotly and the error disappeared! Is there an easier way to update the notebook package versions?

Hm, now the PlotlyKaleido error appears in CI and not locally. I deleted the artifacts and rerun. Still has this error.
I added

begin
	import Pkg
	Pkg.update()
end

to the notebook, still having this error…

You should avoid doing Pkg operations explicitly in notebook unless you need to do it and know the side-effects this bring.

You can update packages inside a notebook using the Pluto.activate_notebook_environment(notebook_path) function on the REPL (not inside the notebook) and using the REPL pkg mode. Check the docstring of the function for more details.

In your specific case though, considering that you don’t plan on using PlotlyKaleido, I’d really go the simple way and simply hiding the logs of the cell calling plotly().

What is strange is that in your local machine your pluto notebook takes stuff from the REPL environment per your comment above. This is not expected with the default Pluto behavior and you’d need to provide some more details on your local setup/environment to help debugging that.

1 Like