You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
# 安装与配置 Polyglot Notebooks
|
|
|
|
|
本文档主要安装与配置`Polyglot Notebook`及`Polyglot Notebook`与`Jupyter`结合使用;
|
|
|
|
|
安装环境 windows11 22H2(Windows Server 2022 21H2)、Python 3.11.4、JupyterNote 7.0.2、 JupyterLab 4.0.4
|
|
|
|
|
|
|
|
|
|
## Polyglot Notebooks 安装及配合
|
|
|
|
|
|
|
|
|
|
`Polyglot Notebook` 是 `VS Code插件`,`VS Code` 使用此插件充当前端UI部分,后台服务是微软基于.net core 开发的 `.net interactive`[项目](https://github.com/dotnet/interactive).
|
|
|
|
|
|
|
|
|
|
安装`Polyglot Notebook`插件时,VS Code会自动安装一些相关的服务:`.net interactive`等。
|
|
|
|
|
|
|
|
|
|
### 前提:
|
|
|
|
|
+ 安装 .Net SDK (当前是 .Net 9)
|
|
|
|
|
+ 安装 VS Code
|
|
|
|
|
|
|
|
|
|
### Polyglot Notebooks 安装及配置
|
|
|
|
|
+ 打开 `VS Code`,插件安装界面输入:C#或.net core,在插件列表中选择并安装相关插件(非必需,但开发c#要先安装上)
|
|
|
|
|
+ 打开 `VS Code`,插件安装界面输入:Polyglot Notebooks 选择并安装 `Polyglot Notebooks`插件
|
|
|
|
|
+ 等待插件安装结束,VSCode会自动安装相关插件和服务
|
|
|
|
|
+ 等待安装结束
|
|
|
|
|
+ VS Code中创建使用 Polyglot Notebooks 略过。有专用的使用学习项目。
|
|
|
|
|
|
|
|
|
|
### 结合Jupyter一起使用
|
|
|
|
|
+ Jupyter 安装`.net interactive`
|
|
|
|
|
|
|
|
|
|
```cmd
|
|
|
|
|
#1安装 `.net interactive` 到.net全局工具
|
|
|
|
|
dotnet tool install --global Microsoft.dotnet-interactive
|
|
|
|
|
|
|
|
|
|
#2安装
|
|
|
|
|
dotnet interactive jupyter install
|
|
|
|
|
|
|
|
|
|
#3 查看验证
|
|
|
|
|
打开jupyter,可以看到里面除python外,还有C#、F#、Powershell等先项
|
|
|
|
|
|
|
|
|
|
#4 vs code中,新建或打开笔记本文件,在内核选择中可以选中本机的 "现有的Jupyter服务",输入地址与密码,连接Jupyter服务。
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 连接到远程 Jupyter 远程服务器
|
|
|
|
|
+ 配置好Jupyter远程服务,使用可以在浏览器中远程访问
|
|
|
|
|
+ 使用远程Jupyter服务
|
|
|
|
|
vs code 中,新建或打开笔记本文件,在内核选择中选中 `现有的Jupyter服务`,输入远程地址与密码,连接到Jupyter服务。
|
|
|
|
|
|
|
|
|
|
### `.net interactive`有一个命令行项目,可以替代vs code的UI层,执行写好的笔记。适合命令行使用。
|
|
|
|
|
|