在VSCode中运行Jupyter Notebook

文章目录

  • 在VSCode中运行Jupyter Notebook
    • 1. 如何在Win10下安装并运行Jupyter Notebook
      • 1.1. Jupyter notebook安装
      • 1.2. jupyter notebook的启动
      • 1.3. 配置Jupyter Notebook
    • 2. VSCode中运行Jupyter notebook
      • 2.1. 安装配置
      • 2.2. 使用方法

在VSCode中运行Jupyter Notebook

1. 如何在Win10下安装并运行Jupyter Notebook

Windows下的Python 3.6.1的下载与安装(适合32bits和64bits)(图文详解)
https://www.bbsmax.com/A/pRdBKK6Pzn/

windows10安装jupyter notebook
https://blog.csdn.net/ahmcwt/article/details/107575914

本机自定义Python的安装目录:D:\Program Files\Python\Python310\Scripts

1.1. Jupyter notebook安装

管理员身份运行Windows PowerShell,输入

python -m pip install jupyter

Jupyter安装到D:\Program Files\Python\Python310\Scripts文件夹内。

1.2. jupyter notebook的启动

jupyter notebook

同时,默认浏览器会打开Jupyter notebook窗口,说明Jupyter安装成功。

1.3. 配置Jupyter Notebook

生成一个配置文件

jupyter notebook --generate-config

config

建立一个保存Jupter Notebook工作的文件夹,如:D:\Documents\Code\jupyter-notebook

将配置文件修改成以上文件夹

set dir

配置文件修改完成后, 以后在 jupyter notebook 中写的代码等都会保存在自己创建的目录中。

jupyter notebook的启动
命令行窗口输入: jupyter notebook

2. VSCode中运行Jupyter notebook

如何在vscode里配置jupyter(用VSCode打开Jupyter笔记本操作和网页版一样)
http://www.studyofnet.com/232288672.html

在VScode中使用Jupyter Notebook的一些技巧
https://www.dgrt.cn/a/278455.html?action=onClick

VS Code不仅支持Jupyter笔记本的基本操作,还可以将笔记本导出为Python文件,并且在编写Jupyter代码时和Python一样,也能用上智能提示(IntelliSense)等功能。

2.1. 安装配置

在VS Code中使用Jupyter笔记本非常方便,只需安装扩展商店中的官方Python扩展包即可。前提是你的系统原来也安装了Jupyer Notebook。

另外在使用Jupyter笔记本前,必须在VS Code中激活Anaconda环境。打开命令面板(Mac用户:⇧⌘P,Windows用户:Ctrl Shift P),输入Python: Select Interpreter选择安装了Jupyter的解释器。

2.2. 使用方法

创建Jupytert笔记本可以在命名面板中输入Python: Create Blank New Jupyter Notebook,或者直接创建一个后缀名为.ipynb的文件。

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
青葱年少的头像青葱年少普通用户
上一篇 2023年6月26日
下一篇 2023年6月26日

相关推荐