Jupyter notebook only works in base environment

烂漫一生 提交于 2019-12-10 20:56:58

问题


Jupyter notebook stopped working as usual suddenly today.

If I launch Jupyter like this then everything works fine in base environment.

activate base
jupyter notebook

But launching it in any other environment or simply without declaring environment

activate XXX
jupyter notebook

results as a localhost:8889/tree blank page in browser.

Also there are no errors in Jupyter console.

I have reinstalled Anaconda and Jupyter, restarted PC and used ip 127.0.0.1 instead of localhost, but nothing helps.

What should I do? I really need to get environments back up fast.


回答1:


Once you activate your conda environment, try to install Jupyter for that environment:

conda activate XXX conda install -c anaconda jupyter

Hope it helps.




回答2:


A better way is to have one Jupyter with multiple kernels depending on your environment:

So all you need is:

conda activate my_env
(my_env) conda install ipykernel -y
(my_env) python -m ipykernel install --user --name my_env --display-name "My Env"
(my_env) conda deactivate

Now you can open Jupyter and you will see “My Env” as a possible kernel. ;)

See: Anaconda Documentation



来源:https://stackoverflow.com/questions/55244348/jupyter-notebook-only-works-in-base-environment

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