-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation: jupyter doc & API discussion #269331
Comments
I embedded Quarto in Jupyenv several months ago, and it works perfectly.
|
What are the limitations? I felt in fixing pkgs.jupyter, I would like to unify the API with pkgs.jupyter-console. |
I've tried to create a multikernel jupyter experience and this was a bit maddening. Here was my experience writing the following shell
1/ When I enter the shell without setting the value of IPYTHONDIR, it gets set to /ipython, which triggers:
2/ similarly, if I dont set JUPYTER_CONFIG_DIR I get:
3/ the all-packages.nix ihaskell derivation is backwards: instead of being haskellPackages.ihaskell, 4/ similarly, when I entered my shell and ran 5/ I've got the same feeling about pkgs/applications/editors/jupyter/console.nix, looks it doesn't know what it wants to be. What I would like to do:
As for backwards compability we would throw exceptions with the new way to define the equivalent ? I am willing to prepare an MR if there is interest/agreement. |
to sum up, the saner expression is to ignore all the surprising top-level wrappers and use the base packages. This does what I expect in a shell: find the kernel in JUPYTER_PATH (in the final derivation, we would wrap it).
|
Hmm, I don't think you should be running into this much trouble making an environment. If you look at the jupyter-all = jupyter.override {
definitions = {
clojure = clojupyter.definition;
octave = octave-kernel.definition;
# wolfram = wolfram-for-jupyter-kernel.definition; # unfree
};
}; Now, there's a bit of a wrinkle where you're trying to add additional packages to your Python environment. My instinct would be to handle this as part of the Python kernel definition. My general plan for this stuff has been as follows:
# Jupyter lab with two kernels, each with custom packages
jupyter.withKernels (kernels: [
kernels.python.withPackages (ps: [ps.matplotlib ps.scipy])
kernels.haskell.withPackages (ps: [ps.aeson])
])
# Jupyter console with kernel with custom packages
jupyter-console.withKernel jupyter-kernels.python.withPackages (ps: [ps.matplotlib ps.scipy]) |
I dont think it should be that complex either. I dont like the use of "override" in your example, in my mind, it's reserved to change things one shouldn't. I think I agree with all your points. Some packages will have to be inherited from elsewhere, e.g., ihaskell derivation is generated from hackage. If @natsukium agrees let's do that ? Also to keep track of my hardship/discoveries:
To sump ihaskell code is hard to use in nixpkgs because of this trick, and the flake implementation is convoluted. |
and my previous setup listing python packages would work with jupyter-console but not jupyter-notebook because it hit #255923 aka my shell had a plain python that couldn't find the files expected by notebook.
but this would in turn break because the (other) python environment used as my python kernel was missing
. There is no reason it should be this complex except manpower. Now we have a taskforce let's make jupyter+nix enjoyable ! |
@natsukium do you agree with the plan ? At least with the easy part:
I have some cycles to allocate to that. I am interested in adding It might be interesting to create a #jupyter room in the nixpkgs matrix space, no ? |
Sorry, I missed the notification. The proposed plan seems fine to me. Could you please proceed as such? |
@teto Due to the lack of response from maintainers to my PRs in jupyenv for a long time, I've decided to support this issue thoroughly. My current plan is first to migrate kernels to nixpkgs for unified maintenance |
thanks to the moderation team, we have a room to discuss implementation details, I've invited all of you https://matrix.to/#/#jupyter:nixos.org |
Problem
I first thought I could rely on jupyterwith (now jupyenv https://github.com/tweag/jupyenv) but it has been unreliable and having strong (jupyter) foundations in nixpkgs is helpful anyway.
Jupyter is so complex, it's the perfect ecosystem for nix to shine (notwithstanding the everevoling python packages).
Proposal
With 23.05 branched off, I wonder if anyone would be willing to start documenting how to create a jupyter notebook with several kernels avaialbe in the nixpkgs documentation ?
I am currently trying to build one such notebook so I could prepare a skeleton but I might be short on time.
My goal would be to just get the ball rolling so that we have a nice doc for 24.05 .
@thomasjm you might be the most motivated with the quarto project ?
@natsukium @GTrunSec @GaetanLepage
Checklist
Priorities
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: