基於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