question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What does `nb_conda_kernels` do?

See original GitHub issue

nb_conda_kernels got added to my Anaconda installation on an update a few months back. Since then I’ve been confused as to what it does - it seems to make sharing Notebooks harder. What am I missing?

Here’s my workflow:

  • Create a new environment for a project using conda
  • Make some Notebooks, commit to git, share to collaborator
  • Collaborator makes a similar environment, clones my repo
  • Using an activated environment the collaborator, having the same named project environment, is asked to select an environment (and presumably this changes the metadata for the Notebook)

I don’t understand why this just doesn’t use the default environment that jupyter notebook was run from. What’s the advantage to me of activating an environment, starting a Notebook, then having to choose the same environment (and/or having a collaborator mess with the metadata when we’re sharing Notebooks)?

What’s the thinking behind fixing a Notebook to a (edit - removed “machine”) specific environment name?

Update - I’ve now upgraded to 2.0 (which still required me to choose a kernel when I started a Notebook), I see on the installation page that I could also run python -m nb_conda_kernels.install --enable --prefix="%CONDA_PREFIX" which I’ve done because it looks magic, but not because I know what it’ll fix.

For reference the Notebook metadata in this case contains:

  "kernelspec": {
    "name": "conda-env-fds-py",
    "display_name": "Python [conda env:fds]",
    "language": "python"
  },```

Hoping someone can set me straight...

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jankatinscommented, Sep 13, 2016

[note: most of this information is based on my usage of the environment_kernel_manager which more or less has the same idea as nb_conda_kernels]

The kernel isn’t specific to the machine, it uses a name defined by the conda environment name: in this case the nb_conda_kernels creates a (virtual) kernel spec for each conda environment (which has a kernel installed?). So if you both have nb_conda_kernels installed and the same name for the projects conda environment, it should work.

Just to comment on the idea for a newish workflow:

  • install jupyter notebook in a new/root environment which only contains the notebook (i.e. no “project related” stuff) -> you only need to install the notebook once.
  • create a new environment for your project via conda (e.g. via a environment.yml file in your project dir) and install IPykernel in there
  • start the notebook server from the root/first environment in the project directory (e.g. via full path to jupyter.exe or whatever it is called on mac/linux)
  • create a new notebook by choosing the kernel from the project environment -> you don’t need to activate the env! [… hack and share …]
  • get your collaborator to create the same environment(s), especially an environment with the same name as your project environment
  • open notebook and it should work

The “default name” is actually depended on having a jupyter kernel in the same environment as the jupyter notebook, which does not need to be the case (at least I tried to remove it, but conda didn’t let me, bu AFAIK there shouldn’t be a technical reason other than not confusing the user).

0reactions
damianavilacommented, Apr 10, 2017

Closing this one since the original discussion stopped a long time ago. Please reopen (or open a new issues) if you have further questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub - Anaconda-Platform/nb_conda_kernels
This extension enables a Jupyter Notebook or JupyterLab application in one conda environment to access kernels for Python, R, and other languages found...
Read more >
Nb Conda Kernels - :: Anaconda.org
Launch Jupyter kernels for any installed conda environment. Conda · Files · Labels · Badges. License: BSD 3-Clause; 917683 total downloads ...
Read more >
nb-conda-store-kernels - PyPI
This extension enables a Jupyter Notebook or JupyterLab application to access environments stored in Conda-Store and run kernels for Python, R, ...
Read more >
Get Your Conda Environment to Show in Jupyter Notebooks
1. First, install nb_conda_kernels in your base environment. · 2. Next, create a new environment. · 3. Activate the environment you want to...
Read more >
Using Jupyter Notebook extensions - Anaconda Documentation
With Anaconda you can download and install 4 extensions for the Jupyter Notebook ... Notebook Conda (nb_conda); Notebook Conda Kernels (nb_conda_kernels).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found