- Verify the kernel you are using has a
${path}/share/jupyterpath, so it can be recognized by the commandjupyter kernelspec list - Run
nix-shell, and if everything is successful, check if the kernels are listed
Created
February 11, 2022 21:20
-
-
Save WolfangAukang/fac08101a9798a3700985326f3af5cb3 to your computer and use it in GitHub Desktop.
Using custom kernels in Jupyter through Nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { pkgs ? import <nixpkgs> {}, pythonPackages ? pkgs.python39Packages }: | |
| let | |
| kernels = with pythonPackages; [ | |
| ansible-kernel | |
| ilua | |
| ]; | |
| in pkgs.mkShell { | |
| buildInputs = with pythonPackages; [ | |
| jupyterlab | |
| numpy | |
| scipy | |
| matplotlib | |
| ] ++ kernels; | |
| shellHook = '' | |
| # kernels | |
| export JUPYTER_PATH="${pkgs.lib.concatMapStringsSep ":" (p: "${p}/share/jupyter/") kernels}" | |
| echo Lets do some python | |
| alias start="jupyter lab" | |
| ''; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment