本文简要记录如何配置 jupyter notebook
来运行 C
等其他类型的文件 1。
本地环境 macOS 12.6.3
,python
版本 3.8.11
,CLion 2021.3
。前提是你已经安装好 jupyter notebook
在本机上了哈。
更新:2023 / 3 / 18
因为作者本人之前已经配好 python
的相关环境了…所以在本文中不再赘述。网上也很多现成的资料哈。
jupyter-c-kernel
sudo pip3 install jupyter-c-kernel
安装 jupyter-c-kernel
2,如下所示:~ % pip3 install jupyter-c-kernel
Collecting jupyter-c-kernel
Downloading jupyter_c_kernel-1.2.2.tar.gz (4.4 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: jupyter-c-kernel
Building wheel for jupyter-c-kernel (setup.py) ... done
Created wheel for jupyter-c-kernel: filename=jupyter_c_kernel-1.2.2-py3-none-any.whl size=6618 sha256=5961beab89f38aabc7e8dfb87e33c1a4a84b4a2985a2d30eeb68a2cab0df3feb
Stored in directory: /Users/xueshanzhang/Library/Caches/pip/wheels/6a/e5/2b/afe567f0fc6ff534cda2bb4202ee1bcdf58b6d0f47cf26f4b8
Successfully built jupyter-c-kernel
Installing collected packages: jupyter-c-kernel
Successfully installed jupyter-c-kernel-1.2.2
再于终端输入 jupyter kernelspec list
3,查看 jupyter-c-kernel
是否位于输出结果中,如下所示:
~ % jupyter kernelspec list
Available kernels:
c ……/Library/Jupyter/kernels/c
python3 /Applications/miniforge3/share/jupyter/kernels/python3
jupyternotebook /usr/local/share/jupyter/kernels/jupyternotebook
jupyter notebook
现在是否可以新建和编辑 C
文件了CLion
的终端中输入 jupyter notebook
,会跳出 jupyter notebook
的编辑页面。在 New
的下拉菜单中已经出现了 C
的选项,如下图所示:C
的开发环境啦~尝试了一圈,没安装成功 …
世上无难事…只要肯放弃!
参考这里,可以选择用网页在线版 Binder
网站 来作为替代。
jupyter notebook kernel安装+自动补全 ↩︎
Jupyter Notebook内运行C ↩︎
jupyter notebook 安装 C/C++ kernel ↩︎