Code Monkey home page Code Monkey logo

Comments (7)

fcollonval avatar fcollonval commented on May 27, 2024 1

JupyterLab does not run in a conda environment, it's a traditional install with PyPi.

Ok this is the reason it is not working out of the box.
So nb_conda_kernels works by setting the kernelspecmanager of JupyterLab server:

NotebookApp.kernel_spec_manager_class = "nb_conda_kernels.CondaKernelSpecManager"

So nb_conda_kernels needs to be discoverable within the JupyterLab environment. So the easiest is to install JupyterLab and that package as the base conda environment.

from gator.

fcollonval avatar fcollonval commented on May 27, 2024 1

When I create an environment the kernel shows up right away in the launcher, but it doesn't go away when I delete an environment until after I restart my jupyterlab session.

There is different pieces of code at work here. So first nb_conda_kernels as a cache time to not refresh too often. Then JupyterLab itself is requesting the kernel specs manager periodically - you can track the network request to kernelspecs endpoint (if I remember correctly the interval for the latter is longer than the cache time). And then the launcher needs to be notified to be updated. So the all process takes indeed some time. But it should work. Did you try to open a fresh launcher after 2 or 3 minutes?

from gator.

fcollonval avatar fcollonval commented on May 27, 2024

Hey @hakasapl

Thank you for reaching out. This package depends on nb_conda_kernels that does that.

Could you try the following command in the base environment to see if it lists the user conda environment?

python -m nb_conda_kernels list

If it does not, you may want to try the enabling command:

python -m nb_conda_kernels.install --enable

from gator.

hakasapl avatar hakasapl commented on May 27, 2024

I do see my environments there:

$ python3 -m nb_conda_kernels list
[ListKernelSpecs] [nb_conda_kernels] enabled, 1 kernels found
Available kernels:
  conda-env-.conda-Test-py    /home/<user>/.conda/envs/test/share/jupyter/kernels/python3
  python3                     /modules/apps/python/3.8.5-jhub/share/jupyter/kernels/python3

But still nothing in the launcher.

Maybe the kernels are in the wrong spot? User-side kernels I would usually install in ~/.local/share/jupyter/kernels, not ~/.conda/envs. JupyterLab does not run in a conda environment, it's a traditional install with PyPi.

from gator.

hakasapl avatar hakasapl commented on May 27, 2024

I had installed nb_conda_kernels in the same Python installation that JupyterLab is, so it should be discoverable, right? Is there any way to change where nb_conda_kernels saves the kernelspecs?

Let me set this up in a conda environment instead, and I'll get back to you.

from gator.

hakasapl avatar hakasapl commented on May 27, 2024

That worked! Not sure if this is a bug or not, but if it is I can start another issue (probably more of a nb_conda_kernels issue): When I create an environment the kernel shows up right away in the launcher, but it doesn't go away when I delete an environment until after I restart my jupyterlab session. Really minor, but let me know if you want me to spin up another issue for that. I'm closing this for now, thanks!

from gator.

hakasapl avatar hakasapl commented on May 27, 2024

I don't think I waited that long, maybe a minute at the most, but that makes sense. Thanks for letting me know!

from gator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.