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.

conda 4.4.7 does not work with nb_conda_kernels in new/reinstalled envs

See original GitHub issue

In base env my launch log for a jupyter notebook looks like that:

(stable) └─❱❱❱ conda activate base                                                   +9035 17:51 ❰─┘

┌─( ~/D/src )────────────────────────────────────────────────────────────────────────( @macd2860 )─┐
(base) └─❱❱❱ jn .                                                                    +9036 17:51 ❰─┘
[I 17:51:31.745 NotebookApp] [nb_conda_kernels] enabled, 8 kernels found
[I 17:51:32.046 NotebookApp] Loading IPython parallel extension
[I 17:51:32.063 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.3.0
[I 17:51:32.066 NotebookApp] Serving notebooks from local directory: /Users/klay6683/Dropbox/src
[I 17:51:32.066 NotebookApp] 0 active kernels

I recently reinstalled by stable setup, which is a Python 3.6 env with all my everyday packages and no GH master stuff. Since the reinstall, nb_conda_kernels can’t call conda from within the stable env:

(base) └─❱❱❱ conda activate stable                                                   +9037 17:52 ❰─┘

┌─( ~/D/src )────────────────────────────────────────────────────────────────────────( @macd2860 )─┐
(stable) └─❱❱❱ jn .                                                                  +9038 17:52 ❰─┘
[E 17:52:50.245 NotebookApp] [nb_conda_kernels] couldn't call conda:
    [Errno 2] No such file or directory: 'conda': 'conda'
[I 17:52:50.246 NotebookApp] [nb_conda_kernels] enabled, 0 kernels found
[I 17:52:50.540 NotebookApp] Loading IPython parallel extension
[I 17:52:50.557 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.3.0
[I 17:52:50.560 NotebookApp] Serving notebooks from local directory: /Users/klay6683/Dropbox/src
[I 17:52:50.560 NotebookApp] 0 active kernels

while my older envs still work fine, e.g. my Python 3.5 env.

I noticed that I can of course run my work from the base env because my kernels from the other envs are being found there, but imagine it wouldn’t be working there as well, then I couldn’t work at all, because I don’t recall anymore how to manually install kernels, so scary indeed.

I’m running these on a macOS 10.12.6 with miniconda3 and conda-forge as default.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18

github_iconTop GitHub Comments

4reactions
benbovycommented, May 21, 2018

I don’t think this issue has been fixed yet.

Running from jupyter,nb_conda_kernels tries to call the conda executable to get information about all the environments.

The problem is that since conda 4.4 it appears there is no link to the conda executable added to new/reinstalled envs, which therefore cannot be found in $PATH, hence the error above.

For environments that have been created before conda 4.4 it still works because a link to the conda executable is still present in those envs. This also works with the base environment since the conda executable is installed in that env.

A workaround for new/reinstalled envs would be for example to manually create a symlink to the conda executable in their bin folders.

A cleaner solution would be that nb_conda_kernels uses the $CONDA_EXE env variable to find the conda exectuable.

xref: https://github.com/jupyterlab/jupyterlab/issues/4598

2reactions
tjd2002commented, Jul 4, 2018

Thanks @mcg1969. It looks like the 2.1.1 packages are all up on conda-forge now! https://anaconda.org/conda-forge/nb_conda_kernels

However, after installing this package on my mac, the extension is not enabled by default. I have to run: python -m nb_conda_kernels.install --enable

This used to be done in a post-link script that was shipped in the package. Is this change intentional?

[Also, if Continuum is not going to update this package in defaults, should it be removed from there?]

Read more comments on GitHub >

github_iconTop Results From Across the Web

Conda environments not showing up in Jupyter Notebook
I don't think the other answers are working any more, as conda stopped automatically setting environments up as jupyter kernels. You need to...
Read more >
Troubleshooting — conda 22.11.1.post16+ce4e810c9 ...
Running conda create --help shows: Networking Options: -k, --insecure Allow conda to perform "insecure" SSL connections and transfers.
Read more >
Why You Need Python Environments and How to Manage ...
But now you've tried to run it, and it is not working. ... the Conda (the package & environment management system) and; the...
Read more >
Efficient Way to Activate Conda in VSCode - Medium
Option 2: Run “conda activate <env-name>” in terminal. The second way is to have manual control of switching the conda environment in the...
Read more >
How do I activate a conda environment in my .bashrc?
The options above will permanently enable the 'conda' command, but they do NOT put conda's base (root) environment on PATH. To do so,...
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