今天使用conda创建了一个纯净的虚拟环境,在这环境里面装了一些包。
然后我在这个环境下想使用jupyter notebook,但是发现jupyter notebook使用的还是base环境里的python。
我使用的是win,所以我看了下python命令的路径:
(rasa) D:\exec\rasa\rasa\Scripts>where python
D:\exec\rasa\rasa\Scripts\python.exe
C:\ProgramData\Anaconda3\python.exe
可以看到python在两个路径中,我们运行python会执行虚拟环境的中python。
(rasa) D:\exec\rasa\rasa\Scripts>where jupyter
C:\ProgramData\Anaconda3\Scripts\jupyter.exe
在看jupyter,它只存在base环境中,所以会打开base环境中的jupyter,而它的默认kernel就是base的kernel。
如果想更换kernel,就需要安装nb_conda_kernels了,安装之后就好了。
网友评论