J u p y t e r Jupyter Jupyter内核环境的管理
首先声明: J u p y t e r N o t e b o o k / L a b Jupyter Notebook/Lab JupyterNotebook/Lab可以用于多种语言,以下以 P y t h o n Python Python作为示例:
一个说明
如果想在某个
P
y
t
h
o
n
Python
Python虚拟环境下使用
J
u
p
y
t
e
r
Jupyter
Jupyter,那么该虚拟环境中必须安装的是
J
u
p
y
t
e
r
Jupyter
Jupyter内核ipython
和ipykernel
,大可不必安装
J
u
p
y
t
e
r
N
o
t
e
b
o
o
k
/
L
a
b
Jupyter Notebook/Lab
JupyterNotebook/Lab,后者只是在浏览器里面提供一个GUI
界面。
换句话说,只要在主环境安装了 J u p y t e r N o t e b o o k / L a b Jupyter Notebook/Lab JupyterNotebook/Lab界面,那么就可以使用不同的 P y t h o n Python Python虚拟环境作为 J u p y t e r Jupyter Jupyter内核。
1. 把当前所在 P y t h o n Python Python虚拟环境添加到 J u p y t e r Jupyter Jupyter内核列表
注:一定要先激活当前所在的虚拟环境
python -m ipykernel install --user --name new_jupyter_kernel_name
new_jupyter_kernel_name
你给这个添加的
J
u
p
y
t
e
r
Jupyter
Jupyter内核起的名字,可以与当前所在
P
y
t
h
o
n
Python
Python虚拟环境的名称不同。
2. 查看已有的 J u p y t e r Jupyter Jupyter内核列表
jupyter kernelspec list
3. 删除某个 J u p y t e r Jupyter Jupyter内核
jupyter kernelspec uninstall jupyter_kernel_name