我已经安装了 xeus、xeus-cling 和 jupyter 扩展程序。我将内核更改为 C++ 版本之一,将单元语言更改为 C++,但是当我单击运行时,单元永远不会输出。有人可以帮我解决这个问题吗?
最佳答案
在 vs-code 下运行 xeus-cling
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
在窗口顶部会弹出一个列表,看起来像
选择现有或将 token 复制到其中
现在应该会出现一条消息重新加载内核,点击按钮这样做
在底部栏中选择内核,例如C++14
创建一个新的空白 jupyter 工作表,不要忘记将单元格更改为 C++!
关于c++ - 在 VSCode Insiders 中运行 C++ Jupyter Notebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66408814/