Jupyter notebook 内核设置

添加虚拟python内核到jupyter

$source SciPyEnv/bin/activate
(SciPyEnv)$python -m ipykernel install --user --name=scipyEnv

接下来你就能看到jupyter可以调用虚拟内核了

本地jupyter的内核查看

$jupyter kernelspec list
Available kernels:
  python3     /home/blacklee/.local/share/jupyter/kernels/python3
  SciPyEnv    /home/blacklee/.local/share/jupyter/kernels/scipyenv

可以看到实际上是在之前文件夹新增了virtualEnv配置文件夹,目录如下

.
├── python3
│   ├── kernel.json
│   ├── logo-32x32.png
│   └── logo-64x64.png
└── scipyenv
    ├── kernel.json
    ├── logo-32x32.png
    └── logo-64x64.png

kernel文件的内容:

    {
     "argv": [
      "/home/blacklee/PyEnvs/SciPyEnv/bin/python",
      "-m",
      "ipykernel_launcher",
      "-f",
      "{connection_file}"
     ],
     "display_name": "SciPyEnv",
     "language": "python"
    }

删除kernel

jupyter kernelspec uninstall SciPyEnv

猜你喜欢

转载自www.cnblogs.com/bigbigworf/p/12813455.html
今日推荐