win10+conda在jupyter notebook中添加c/c++的kernel

win10+conda 在jupyter notebook中添加c/c++的kernel

最近在准备复试的时候发现如果用jupyter看书写代码会更方便,上网找jupyter写c++代码的方式,一堆问题,乱七八糟,在官方网站上找到了正确的安装方法,记录一下。

One thing that I always found missing in Jupyter Notebook was the support for the C++
 language. Of course, the reason it was not supported was that C++ programs have to be
 first compiled and then executed unlike Python which is an interpreted language and that’s
 why we are able to use it in Python or IPython prompt.

1.开始安装

c和c++是由不同的kernel支持!安装过程中要用conda新建一个虚拟环境,以防止c++的一些包和原来python环境中的一些包产生重复。

1)创建新的虚拟环境,命名为cling,

conda create -n cling

2)激活刚刚创建的环境

conda activate cling

3)在新环境下安装jupyter notebook

conda install jupyter notebook
  1. 在刚刚安装的环境里面安装 conda-forge
conda install -c conda-forge cling //注意这里的名字是环境名

5)安装完成后看看有没有出现kernel

jupyter kernelspec list

如果出现c++的样子那就是成功了

2.在jupyter上打开,选择对应的kernel即可

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值