问题
I am planning to use virtual environment in jupyter notebook through the following steps:
conda create -n test python==3.6
conda activate test
ipython kernel install --user --name=test
Then i get the following in return:
Installed kernelspec test in C:\Users\User\AppData\Roaming\jupyter\kernels\test
which seems to be working when I saw the test kernel appeared in jupyter notebook.
However, when I switch to that kernel, it is actually using my default python enviroment.
I also checked the existing kernels with:
λ jupyter kernelspec list
Available kernels:
shjh C:\Users\User\AppData\Roaming\jupyter\kernels\shjh
test C:\Users\User\AppData\Roaming\jupyter\kernels\test
python3 C:\Users\User\Anaconda3\share\jupyter\kernels\python3
It is there but not working ...
Any suggestions how to fix this.
回答1:
Not sure what is causing the problem. But luckily I found a working solution.
First I removed the installed kernel with
jupyter kernelspec uninstall <kernel name>
then added again with ipykernel:
conda create -n test python==3.6
conda activate test
(test) λ pip install ipykernel
(test) λ python -m ipykernel install --name test --display-name "some name"
来源:https://stackoverflow.com/questions/56470407/kernel-appeared-in-jupyter-notebook-but-not-working