NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.11k stars 14.15k forks source link

Please add jupyterlab as tool #170747

Open schlichtanders opened 2 years ago

schlichtanders commented 2 years ago

Project description While jupyterlab is available as a python package (python39Packages.jupyterlab and python38Packages.jupyterlab as of today), there is no respective app to be found in nixpkgs (like I would expect jupyterlab).

What can be found is jupyter, which however seems to point to the notebook and not the lab.

Jupyterlab is a Web-Based development environment for interactive use for multiple languages. It is widespread, has probably millions of users and would be nice to have packaged in nixpks.

Metadata

teto commented 2 years ago

you can try https://github.com/tweag/jupyterWith till then I think

schlichtanders commented 2 years ago

two current options to install jupyterlab

two aspects which should just work by using jupterlab itself

installing kernels

works pretty well out of the box with python3packages.jupyterlab, however the package is broken and cannot be installed on current 22.05 channel. I don't understand how it can be that a package is broken on the stable channel... probably a good reason to make this a proper tool instead of python package

the mentioned jupyterWith defaults to a declarative way of defining kernels which for most users is just overpowered if the standard jupyterlab commandline would work too.

installing extensions

haven't tried this yet for python3packages.jupyterlab, but for jupyterWith it is anyway manual, hence probably a similar manual approach could be taken for python3packages.jupyterlab

summary

please

chuangzhu commented 1 year ago

python3packages.jupyterlab - unfortunately fails to build on current channel 22.05

I think it is fixed now, please reopen if I'm wrong.

[chuang@hawthorn:~]$ nix repl
Welcome to Nix 2.11.0. Type :? for help.

nix-repl> :lf github:NixOS/nixpkgs/nixos-22.05
Added 14 variables.

nix-repl> pkgs = legacyPackages.x86_64-linux

nix-repl> :b pkgs.python3.withPackages (p: with p; [ numpy jupyterlab ]) 

This derivation produced the following outputs:
  out -> /nix/store/036ipgniv8iks6pqszzayxz2zyps38s4-python3-3.9.15-env
schlichtanders commented 1 year ago

Thank you @chuangzhu for your help. The issue is however not completed as far as can see. The python package jupyterlab may work again, however there is still no app jupyterlab.

chuangzhu commented 1 year ago

IMO python3Packages.jupyter is much easier to use than the standalone jupyter. You just put it to a python3.withPackages and it works with other packages. With the standalone jupyter you need to override the jupyter-kernel to add packages to the environment. So I'm curious why you would want a standalone jupyterlab. This question also applies to #202996 as well.

schlichtanders commented 1 year ago

if I cannot install jupyter kernels using jupyter command line and user home directory for storage, then I guess you can file an issue to jupyter, as this is standard usage of the jupyter tool in the wild.

(Similar how it is a standard usage of python to create local virtual environments - in fact they work seamlessly)

In nix you have (at least) two kind of derivations:

  1. software packages/libraries
  2. tools/applications

Obviously python3packages.jupyter is the first, while I am looking for using jupyter as an official tool/app. The difference is NOT about functionality (like being able to install extensions into the home directory), but about how it is indended to be used (namely as a standalone tool in my case, and not as a python library which I import in my python project).