c++ - 在 VSCode Insiders 中运行 C++ Jupyter Notebook

标签 c++ visual-studio-code jupyter-notebook xeus-cling

我已经安装了 xeusxeus-clingjupyter 扩展程序。我将内核更改为 C++ 版本之一,将单元语言更改为 C++,但是当我单击运行时,单元永远不会输出。有人可以帮我解决这个问题吗?

最佳答案

在 vs-code 下运行 xeus-cling

enter image description here

Ceus 在 vs-code 环境中工作。您必须激活您的 conda 环境并从中调用 vs-code(我使用代码内部版本)。在linux中这看起来像

conda activate xeus-cling # my env for xeus-cling; where i compiled cling

然后在你的项目目录中调用代码(内部人员)

code-insiders .& # or code .& if you are using the stable version

如果仍有问题,请尝试以下操作:

  • 从命令行启动一个 jupyter notebook(当然是在你上面描述的 conda 环境中)

     jupyter notebook --no-browser
    

    复制或记住带有 token 的行,类似于 http://127.0.0.1:8888/?token=8daf8f57bef55918defb467defc55f0305803caa27dd01d2

  • 接下来进入code-insiders并点击底部栏Jupyter Server: Remote enter image description here

  • 在窗口顶部会弹出一个列表,看起来像

enter image description here

  • 选择现有或将 token 复制到其中

  • 现在应该会出现一条消息重新加载内核,点击按钮这样做

  • 在底部栏中选择内核,例如C++14

  • 创建一个新的空白 jupyter 工作表,不要忘记将单元格更改为 C++!

关于c++ - 在 VSCode Insiders 中运行 C++ Jupyter Notebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66408814/

相关文章:

python - 如何在 Jupyter 笔记本中显示之前生成的绘图?

jupyter-notebook - 如何在 Jupyter Notebook 中设置 session 的保存位置?

c++ - 从 .SVG 文件创建 QIcon 后为空

node.js - vscode 警告第一个参数未使用,但我使用后面的参数

visual-studio-code - Ctrl-Left/Right 在 Visual Studio Code 上不适用于多个光标

dart - 如何使用 Angel 在服务器端 Dart 上获取 Redis 键值

macos - 在 IPython 或 Jupyter Notebook 中显示可旋转 3D 绘图

c++ - 如何判断 Targa 是否来自 Photoshop?

C++ 将对象实例化到 STL 容器中

c++ - 使用 boost::async_connect 问题