Skip to content
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

How to disable ipykernel / configure it? #181

Closed
doronbehar opened this issue Dec 14, 2021 · 6 comments · Fixed by #182
Closed

How to disable ipykernel / configure it? #181

doronbehar opened this issue Dec 14, 2021 · 6 comments · Fixed by #182

Comments

@doronbehar
Copy link

I'd like to configure a jupyter environment and I'd like it to present only a single python Notebook in the launcher. Currently, if I use:

devShell = (jupyterlabWith {
  kernels = [];
}).env

I still see ipykernel in the launcher:

Screenshot from 2021-12-14 22-17-43

And if I use:

devShell = (jupyterlabWith {
  kernels = [
    (kernels.iPythonWith {
      name = "python";
      packages = p: [p.pint];
    })
  ];
}).env

I get another python launcher:

Screenshot from 2021-12-14 22-21-48

And I noticed that the python module pint is not available in the ipykernel notebook, but it is available in the right launcher.

How do I disable the ipykernel launcher?

@GTrunSec
Copy link
Collaborator

GTrunSec commented Dec 14, 2021

looks like the the ipykernel was wrapped by jupyterlab.

jupyter kernelspec list
Available kernels:
  python3      /nix/store/n2sxhzm1d38r9p2lgj6ww7b84bl81y53-python3.8-ipykernel-5.5.0/lib/python3.8/site-packages/ipykernel/resources
  • Reproduced command
nix-shell -p 'python3.withPackages(ps : with ps; [ jupyterlab ])' --command 'jupyter kernelspec list


nix-shell -p 'jupyter' --command 'jupyter kernelspec list'
Available kernels:
  python3    /nix/store/pckir9hzqqzsark8vbwh3rzig8qg74z0-python3.9-ipykernel-6.4.1/lib/python3.9/site-packages/ipykernel/resources
Available kernels:

@doronbehar
Copy link
Author

doronbehar commented Dec 14, 2021

looks like the the ipykernel was wrapped by jupyterlab.

I also noticed that, and I can't trace where this launcher is defined.

@GTrunSec
Copy link
Collaborator

please try:

jupyter lab --KernelSpecManager.ensure_native_kernel=False

@guaraqe
Copy link
Contributor

guaraqe commented Dec 15, 2021

The first time I tried removing this kernel, I failed, but this is something I would like for some time. Like 1/3 of the issue reports are about Python packages not working because people clicked on the wrong kernel.

@GTrunSec Is this a new flag? If this works, we could add it by default.

@GTrunSec
Copy link
Collaborator

GTrunSec commented Dec 15, 2021

Is this a new flag? If this works, we could add it by default.

Sure, It works. you can find all of the settings in the config file of jupyter. which means you can do either flag or put it in the config file(~/.jupyter/jupyter_notebook_config.py )

@doronbehar
Copy link
Author

The first time I tried removing this kernel, I failed, but this is something I would like for some time. Like 1/3 of the issue reports are about Python packages not working because people clicked on the wrong kernel.

I think this is a Nixpkgs issue. I also failed to trace the source of this kernel there but perhaps that's possible with some effort. @FRidh since you maintain some of jupyter's related packages in Nixpkgs perhaps you could help here please?

@Etjean Etjean linked a pull request Jan 14, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants