基于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界面


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM