Unable to use @bind from PlutoUI on Colab

Hi everyone! I’m trying to run the Julia code from https://github.com/mitmath/18S191/blob/Fall20/lecture_notebooks/week1/01-images-intro.jl on Colab as I can’t run it on my local machine. Pretty much all cells get executed except the one where Grant utilizes the PlutoUI’s @bind (https://youtu.be/DGojI9xcCfg?t=996) and i get this error as visible in screenshot. Please can anyone help resolving this issue?

begin 
  Pkg.add(["PlutoUI", "MLJBase"])
  using PlutoUI
  using MLJBase
end

@bind repeat_count Slider(1:10, show_value = true)

That stacktrace look suspiciously like an IJulia/Jupyter notebook, are you sure you are running a Pluto notebook?

This simple example works for me without issues:

I’m using the following code block from DataCampPresentation.jl/datacamp-answers.ipynb at main · jverzani/DataCampPresentation.jl · GitHub to set up Julia in Google Colab.

# Installation cell
%%capture
%%shell
if ! command -v julia 3>&1 > /dev/null
then
    wget -q 'https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.2-linux-x86_64.tar.gz' \
        -O /tmp/julia.tar.gz
    tar -x -f /tmp/julia.tar.gz -C /usr/local --strip-components 1
    rm /tmp/julia.tar.gz
fi
julia -e 'using Pkg; pkg"add IJulia PlotlyLight DataFrames CSV Chain FreqTables CategoricalArrays; precompile;"'
echo 'Done'

Not running Pluto notebook as it only works locally and i can’t run these image manipulations on local machine due to device constraints. So, i’m just following the Computational Thinking course video and notebook from GitHub and coding on Colab.

try binder instead of colab

1 Like

Well if you’re not running a Pluto notebook then you shouldn’t expect PlutoUI to work. If you want interactivity in a Jupyter notebook look at

1 Like

I might have made that recommendation, but colab works pretty well

Thanks for the solution!

1 Like