'Jupyter conda tab 'An error occurred while retrieving package information.'
In my root environment I run
$ jupyter notebook
and in the browser, click on the 'Conda' tab. This always used to list my conda environments and the packages in them. Now I'm greeted by the following error.
I recently created and deleted some conda environments, maybe that is relevant. The only console output is
[W 10:30:20.948 NotebookApp] 404 GET /environments?_=1476811818902 (::1) 13.19ms referer=http://localhost:8888/tree
[W 10:30:20.951 NotebookApp] 404 GET /packages/available?_=1476811818903 (::1) 1.77ms referer=http://localhost:8888/tree
Solution 1:[1]
See this issue: https://github.com/Anaconda-Platform/nb_conda/issues/23
The issue seems to be a conflict between the notebook config file in the conda
environment and the config file in the users directory.
To fix the issue and get the tab to display properly the content, I had to remove that file:
rm jupyter_notebook_config.json in ~/.jupyter
Note that, for me, that was not an issue as it did not really contain anything.
Solution 2:[2]
As pointed out at: https://github.com/Anaconda-Platform/nb_conda/issues/23#issuecomment-239813091
The following command helped in resolving the issue:
jupyter serverextension disable nb_conda
jupyter serverextension enable nb_conda
This basically rewrites the config file in the ~/.jupyter folder.
Solution 3:[3]
On windows, running conda install -c conda-forge nb_conda_kernels
worked for me.
Solution 4:[4]
If no of the commands work for you, try adding kernels manually for each of the environments (as pointed out by Andreas Mueller):
source activate <my_environment>
python -m ipykernel install --user --name <my_environment> --display-name "<Display name>"
Solution 5:[5]
I replaced for env in info['envs']]
by for env in info['envs'] if env != info['root_prefix']]
in this pathanaconda3\pkgs\nb_conda-2.2.1-py38_1\envmanager.py
and that solve all errors
Solution 6:[6]
For me I just needed to close the current Jupyter notebook session and start again, then the error disappeared and it was able to load the envs.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | CheTesta |
Solution 2 | Shubhanshu Mishra |
Solution 3 | prashantkumar484 |
Solution 4 | Tomasz Bartkowiak |
Solution 5 | Ahmed Khater |
Solution 6 | Jehad Nasser |