gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 08:02:06 28 4
gpt4 key购买 nike

我已经安装了 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/

28 4 0