VSCode连接Jupyter+切换conda内核

发布时间 2023-04-21 16:14:15作者: rthete

VSCode连接本机Jupyter服务器

  1. 生成配置文件

    jupyter notebook --generate-config
    

  2. 设置密码

    from notebook.auth import passwd
    passwd()
    

  3. 修改配置文件

    c.NotebookApp.allow_remote_access = True
    c.NotebookApp.ip='*'
    
  4. 重启jupyter服务

  5. vscode连接

    服务器URL需要换成以下:

    选择内核即可

    测试成功

Jupyter切换conda内核

jupyter内切换conda环境配置_jupyter切换conda环境_齐亚玛的博客-CSDN博客

【最全指南】如何在 Jupyter Notebook 中切换/使用 conda 虚拟环境?_jupyter notebook conda_Tina姐的博客-CSDN博客

  1. 在conda环境中安装jupyter notebook

    pip install jupyter notebook
    

  2. 安装内核

    python -m ipykernel install --user --name="myjupyter"
    

  3. 查看已有的内核

    jupyter kernelspec list
    

  4. 启动Jupyter服务,可以切换kernel

  5. 删除内核

    jupyter kernelspec remove myjupyter