Hi. Does anybody have a working jupyter notebook with interactive widgets?
My shell.nix
looks like the following, but this does not seem to work.
with import <nixpkgs> { };
let
ps = python38Packages;
in pkgs.mkShell rec {
name = "py38";
venvDir = "./.venv";
buildInputs = [
# A Python interpreter including the 'venv' module is required to bootstrap
# the environment.
ps.python
# This execute some shell code to initialize a venv in $venvDir before
# dropping into the shell
ps.venvShellHook
ps.numpy
ps.matplotlib
ps.scikitlearn
ps.jupyter
ps.seaborn
ps.pandas
ps.ipywidgets
];
# Run this command, only after creating the virtual environment
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
jupyter nbextension enable --py --sys-prefix widgetsnbextension
'';
# Now we can execute any commands within the virtual environment.
# This is optional and can be left out to run pip manually.
postShellHook = ''
# allow pip to install wheels
SOURCE_DATE_EPOCH=$(date +%s)
'';
}