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
Conda environments not detected #112
Comments
Thanks for the report. Note that we're up to 2.2.0 on here now. The relevant code is in |
I'm not sure this is related, but I recently had a look at my jupyter_notebook_config.py in an editor, without changing anything, at least to my knowledge, and since then, my py37 environment wasn't found anymore, while py36 was still there? $ conda remove nb_conda_kernels (py37)
Solving environment: done
## Package Plan ##
environment location: /Users/klay6683/miniconda3/envs/py37
removed specs:
- nb_conda_kernels
The following packages will be REMOVED:
nb_conda_kernels: 2.2.0-py37_1000 conda-forge
Proceed ([y]/n)?
Preparing transaction: done
Verifying transaction: done
Executing transaction: / + /Users/klay6683/miniconda3/envs/py37/bin/python -m nb_conda_kernels.install --disable
Disabling nb_conda_kernels...
ERROR: The global setting does not match the local setting:
Global: ENABLED
Local: DISABLED
This is typically caused by another configuration file in
the path with a conflicting setting.
Use the --verbose flag for more information.
WARNING conda.core.link:run_script(813): pre-unlink script failed for package conda-forge::nb_conda_kernels-2.2.0-py37_1000
consider notifying the package maintainer
done I'm not user what's going on there, but I can assure you that I would not deactivate nb_conda_kernels, it's my life blood, and currently I'm quite nervous, in trying for an hour to get back to a working py37 environment. :/ |
@michaelaye a couple of things. First, where exactly is your
where exactly is your Second, you could try using the verbose enable/disable commands:
This should help us see what's going on. The error you're seeing above is telling me that, somehow, your |
I think my interpretation of "not having my py37 env" in the notebook is merely the renaming how it appears as discussed in other GH issues. $ python -m nb_conda_kernels.install -v --status (py36)
Determining the status of nb_conda_kernels...
Entry points:
- conda = nb_conda_kernels.discovery:CondaKernelProvider
NOTE: entry points not used in Jupyter 5.2.3
jupyter_notebook_config.json entries:
- /etc/jupyter: <no file>
- /usr/local/etc/jupyter: <no file>
* /Users/klay6683/miniconda3/envs/py36/etc/jupyter: {
"NotebookApp": {
"nbserver_extensions": {
"jupyter_nbextensions_configurator": true
},
"kernel_spec_manager_class": "nb_conda_kernels.CondaKernelSpecManager"
}
}
- /Users/klay6683/.jupyter: {
"NotebookApp": {
"nbserver_extensions": {
"jupyterlab_github": true,
"jupyter_nbextensions_configurator": true,
"jupyterlab_git": true,
"nbresuse": true
},
"kernel_spec_manager_class": "nb_conda_kernels.CondaKernelSpecManager"
}
}
Status: enabled Is maybe the settings in .jupyter clashing with the settings in the conda env when asking for an uninstall, creating above error message? |
My envs aren't being found on Mac, but are on Windows. On mac, the contents of {
"NotebookApp": {
"nbserver_extensions": {
"jupyterlab": true
}
}
} The kernels are found however:
UPDATE: Clearly something strange going on with the install:
|
I know this is an old issue but I also don't want to close it in case someone can properly identify a root cause and solution. Note however that in this comment I am seeing two copies of the nb_conda_kernels configuration. The one in |
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:
|
okay, so I had a bunch of problems with this and it sucked up far too many hours of my life. Google ranked this thread up pretty high, so I'm posting it here for posterity. For anyone trying to do add conda-installed kernels in Docker, here is the process:
( |
Maybe this will offer some insight into what was happening above: The issue I was trying fix was that on my system (MacOS, In running through some of the troubleshooting above, I noticed that
was failing to disable the extension.
Notice the status still enabled at the end. I traced through that code, and in the end, realized the (In my case, When I backed nb_conda_kernels all the way back to 2.1.1 (before that code path was refactored) , I finally succeeded in disabling nb_conda_kernels; i.e. the config file was changed to:
Upon re-enabling it, I could finally see all my conda environments (yay). The new config file was
Now, when I attempt to upgrade to nb_conda_kernels 2.2.2, I get the same error as @michaelaye, namely:
|
|
@mcg1969 I think this can now be close as there is a way to render environment visible by jupyter tools. |
For future reference (And searchability), what is that way?
… @mcg1969 <https://github.com/mcg1969> I think this can now be close as
there is a way to render environment visible by jupyter tools.
|
if that were true, i guess the whole project should be archived? I'm also unaware of other jupyter tools that scan all conda envs for available kernels. |
As explain in the README, you can optionally install the virtual conda kernel specs in a place searched for by conda:
{
"CondaKernelSpecManager": {
"kernelspec_path": "--user"
}
}
The kernelspec path needs to be writable by the users as kernelspecs will be dynamically updated by |
@fcollonval I think my |
The json format and the py format are both acceptable. And configuration are merged from the two files (with JSON having a higher priority). So I'll be surprised if To take a parallel, it is like git config. It modifies your git config file. But nevertheless you can change the config file manually.
|
I'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 thebin\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?The text was updated successfully, but these errors were encountered: