You can run Pluto on binder with a custom package environment by creating an appropriate github repository. I don’t know if it’s the best way to do it, but I have a working setup at https://github.com/UBCECON567/ioplutonotebooks. Here’s an example of it on binder. I created this setup by making some minor changes to https://github.com/pankgeorg/pluto-on-jupyterlab
If you want to modify it, you could:
- Clone https://github.com/UBCECON567/ioplutonotebooks
- Replace the contents of the notebooks folder with your notebooks (or maybe just delete it and leave your notebooks in a separate place, so that you can update the notebooks without triggering a rebuild of the binder docker image).
- Modify the version of Julia in the Dockerfile if you want something other than 1.5.3
- Modify the Project.toml and Manifest.toml files. Probably easiest to just delete them and then recreate them by running something like
using Pkg
Pkg.activate("path/to/repo") # modify this
Pkg.add(["Pluto","PlutoUI", "Plots", "Dierckx", "DataFrames", "DataInterpolations"]) #
- Then push your changes, and point mybinder.org to your repository.
Compared to adding packages within a notebook, an advantage of this approach is that package installation and precompilation happens only when the docker the image for the repository is built (or rebuilt after each commit), instead of each time a user opens the notebook. It does, however, take quite some time to rebuild the docker image after the repository is updated.