gpt4 book ai didi

python - 如何将 Jupyter Notebook 连接到 Spyder 内核?

转载 作者:行者123 更新时间:2023-12-03 14:29:07 26 4
gpt4 key购买 nike

相关帖子的回复How to connect to an existing Jupyter Notebook kernel and inspect variables using the Variable explorer?似乎只是不可能 .但是如果我们尝试将 Jupyter Notebook 连接到 spyder 内核呢?那么是否有可能让 Jupyter Notebook、Spyder 和 Spyder 中的变量资源管理器使用内核?

文章Connecting Spyder IDE to a remote IPython kernel让它听起来有点可能:

Doing data science in Jupyter notebook is fun but sometimes you need the ability to poke into variables using the handy variable explorer in Spyder.

Connecting Spyder to a remote kernel is as straightforward as the notebooks. I will walk you through the process.



但是我无法重现这个例子,我有点担心我还没有完全理解作者整篇文章的意思。

这是我尝试过的:

1. conda install spyder-kernels工作正常。

2. 同理 python -m spyder_kernels.console  :

enter image description here

但是我在其他方面遇到了问题,文章没有提到将 Jupyter Notebook 连接到 --existing kernel-19909.json .我的部件也有问题 python -m spyder_kernels.console — matplotlib=’inline’ — ip=x.x.x.x -f=./remotemachine.json .

关于我如何进一步开展这项工作的任何建议?

系统信息:
The version of the notebook server is: 5.6.0
CPython 3.7.0
IPython 6.5.0
compiler : MSC v.1912 64 bit (AMD64)
system : Windows
release : 7
machine : AMD64
CPU cores : 8
interpreter: 64bit

最佳答案

据我了解您的问题,您希望将 IPython 内核连接到本地机器上的 Spyder。您提到的文章描述了远程连接的这个过程,我相信这是让您感到困惑的部分。首先,确保您更新了 Spyder到版本 3.3.3 或更高版本,就像以前一样 a bug that prevented users from seeing their variables in the explorer .这些是进行连接的步骤:

  • 运行 python -m spyder_kernels.console并记下控制台输出中显示的 JSON 文件的名称:To connect another client to this kernel, use: --existing kernel-pid.json .
  • 开通 Spyder .
  • 点击 Consoles在菜单栏中选择 Connect to an existing kernel从下拉菜单中。
  • 在打开的窗口中,输入前面提到的 kernel-pid.jsonConnection file提示并点击 OK .

  • 完成这些步骤后,将出现一个带有已加载内核的新控制台窗口。您现在可以将它与 Variable explorer 一起使用.

    关于python - 如何将 Jupyter Notebook 连接到 Spyder 内核?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55481309/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com