jupyter c++/python/js/ts

jupyter notebook和juypter lab 对windows c++ kernel都支持的不好:

https://github.com/jupyter/jupyter/wiki/Jupyter-kernels

 

如果要用(cling 或者xeus-cling),只能选中*nix平台, 测试windows wsl也可以,步骤如下

 

1.安装wsl

2.装miniconda,不要装anaconda(里面的zmq会和cling冲突)

3.安装python包

1
2
3
conda install     -c conda-forge    jupyterlab
conda install     -c conda-forge    xeus-cling
conda install     -c conda-forge    boost

4.配置jupyter lab

jupyter  lab     --generate-config

jupyter_lab_config.py 内容:(密码abc123)

1
2
3
4
5
6
c.NotebookApp.notebook_dir = '/mnt/d/jupyter'
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.password = 'sha1:9fb88efadb70:8cb38c269297edbbc6a02f5b11ad8d346e2b9fdd'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 33333
c.NotebookApp.allow_remote_access = True
5.如果有权限问题:
chmod 777 /home/wyt/.jupyter/jupyter_lab_config.py
chmod 777 /home/wyt/.condarc
 
6.重启一下wsl(wsl -t debian),不会的话重启电脑
 
7.运行:jupyter-lab
 
8.几个测试代码
1
2
#include <stdio.h>
printf("hello, world.\n");

 

1
2
3
4
5
6
7
8
#include <boost/format.hpp>
#include <boost/tokenizer.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/join.hpp>
 
std::vector<std::string> cmdarray;
boost::split(cmdarray, "abc def.123;456", boost::is_any_of(" .,:;"), boost::token_compress_on);
std::cout << "output size: " << cmdarray.size() << std::endl;

 

 

 

posted on   拥剑公子  阅读(160)  评论(0编辑  收藏  举报

编辑推荐:
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示