Jupyter notebook only works in base environment

时间:2019-03-19 15:16:53

标签: python anaconda jupyter-notebook

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.

2 个答案:

答案 0 :(得分:2)

一旦激活conda环境,请尝试为该环境安装Jupyter:

conda activate XXX conda install -c anaconda jupyter

希望有帮助。

答案 1 :(得分:1)

一种更好的方法是根据您的环境使用一个具有多个内核的Jupyter:

因此,您所需要做的就是:

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

现在,您可以打开Jupyter,您将看到“我的环境”作为可能的内核。 ;)

请参阅:Anaconda Documentation