Jupyter conda tab 'An error occurred while retrieving package information.'

大兔子大兔子 提交于 2019-12-03 06:53:23

问题


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

回答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.




回答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.




回答3:


On windows, running conda install -c conda-forge nb_conda_kernels worked for me.




回答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>"


来源:https://stackoverflow.com/questions/40114639/jupyter-conda-tab-an-error-occurred-while-retrieving-package-information

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!