Conda environments not detected
See original GitHub issueI’ve recently changed from miniconda3 and python 3.6 to anaconda3 and python 3.7. As a result, conda environments are not being detected and added as jupyter kernels.
I have nb_conda_kernels 2.1.1 installed in my base environment (python 3.7.0) and ipykernel 5.1.0 in my external environment (also python 3.7.0).
Within my external environment, I can see a kernel.json
file in ~\anaconda3\envs\env_name\share\jupyter\kernels\python3
and its content correctly points to the bin\python
directory of that environment.
However, jupyter kernelspec list
does not show the environment and it’s not available in either jupyter notebook or lab.
Update
I noticed that my jupyter_notebook_config.py
only had one entry for something else and nothing for nb_conda_kernels. I guessed that means jupyter is using the default KernelSpecManager.
So, I removed that file and restarted jupyter notebook. Kernels all detected and available!!
Even when I put the file back exactly as it was, I can create new environments and they are detected ok.
So - all is now working for me, but is there an issue installing nb_conda_kernels where a jupyter_notebook_config.py
file exists?
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (3 by maintainers)
Top GitHub Comments
So I was having a similar issue, possibly the same as FBen3, I’m going to try to outline the steps I took to get my kernels showing up the way I want them to:
I wanted to make sure I was starting fresh with kernels so I decided to try this.
Well it didn’t fix my issues but it seemed to remove the kernels that looked like the ones in FBen3’s post.
Next step is to make sure you really follow the steps in this post especially for manually registering a kernel that already exists. I’ll try to outline the important ones:
conda install nb_conda_kernels
on the base environment, I believe this is supposed to auto detect new environments in the future but I actually haven’t tested it yet.conda activate
into the environment you want to addconda install notebook ipykernel
. I thought nb_conda_kernels should be picking up the new kernel but it was not so I had to do the next step.ipython kernel install
doesn’t work tryipython kernel install --user
, I believe the--user
flag is for if your kernelspec is located in /Users/… rather than /usr/… If you want a to add a specific name doipython kernel install --user --name [kernel_name] --display-name [kernel_name]
. IF YOU DON’T SPECIFY THE NAME, I THINK IT WILL OVERWRITE YOUR PYTHON3 KERNEL. I’m not a 100% sure on that but I think that’s why they don’t show up.conda deactivate
andjupyter kernelspec list
. You should hopefully start seeing the env names there. In my case this isjupyter notebook
on (base) and you should hopefully see the kernels as normal nowconda install nb_conda_kernels
fixed the problem quite easily since it auto-detects and picks up the existing conda envs