基于Jupyter Notebooks的C# .NET Interactive安装与使用

.NET Interactive发布预览版了,可以像Python那样用jupyter notebooks来编辑C#代码。具体可以在GitHub上查看dotnet/interactive项目。

安装步骤

  • 安装好.NET Core 3.1 SDK
  • 安装好Python 3(默认有pip)
  • 安装Jupyter
pip install jupyter
  • 在命令行检查Jupyter是否正确安装
jupyter kernelspec list
  • 可以安装.NET Interactive了
dotnet tool install -g --add-source "https://dotnet.myget.org/F/dotnet-try/api/v3/index.json" Microsoft.dotnet-interactive
dotnet interactive jupyter install
  • 再次用jupyter kernelspec list查看检查安装好的.NET版本Jupyter,输出如下
  .net-csharp       ~\jupyter\kernels\.net-csharp
  .net-fsharp       ~\jupyter\kernels\.net-fsharp
  .net-powershell   ~\jupyter\kernels\.net-powershell
  python3           ~\jupyter\kernels\python3
  • 新建个项目并打开Jupyter Notebooks
mkdir yourapp
cd yourapp
jupyter notebook
  • 现在可以愉快地使用了,截图如下就OK了

Jupyter Notebooks界面

posted @ 2020-02-26 02:46  冰之K  阅读(1319)  评论(0编辑  收藏  举报