gpt4 book ai didi

python - spyder 和远程 ssh python 解释器

转载 作者:行者123 更新时间:2023-12-01 05:03:31 26 4
gpt4 key购买 nike

我有一个 ubuntu 服务器,可以使用 ssh 连接运行 python 解释器。我想将解释器链接到我的 IDE 之一。

spyder是否支持远程ssh解释器?如果不是,有什么可能的免费替代方案?

编辑:使用新版本的spyder,似乎可以连接到远程shell。但是当我尝试连接时收到此错误

>>> Traceback (most recent call last):
File "/home/donbeo/Applications/spyder-ide-3.4dev/spyderlib/plugins/ipythonconsole.py", line 973, in create_client_for_kernel
self._create_client_for_kernel(cf, hostname, kf, pw)
File "/home/donbeo/Applications/spyder-ide-3.4dev/spyderlib/plugins/ipythonconsole.py", line 1007, in _create_client_for_kernel
if not self.kernel_and_frontend_match(cf):
File "/home/donbeo/Applications/spyder-ide-3.4dev/spyderlib/plugins/ipythonconsole.py", line 898, in kernel_and_frontend_match
profile='default')
File "/usr/lib/python2.7/dist-packages/IPython/kernel/connect.py", line 273, in get_connection_info
info = json.loads(info)
File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Traceback (most recent call last):
File "/home/donbeo/Applications/spyder-ide-3.4dev/spyderlib/plugins/ipythonconsole.py", line 973, in create_client_for_kernel
self._create_client_for_kernel(cf, hostname, kf, pw)
File "/home/donbeo/Applications/spyder-ide-3.4dev/spyderlib/plugins/ipythonconsole.py", line 1007, in _create_client_for_kernel
if not self.kernel_and_frontend_match(cf):
File "/home/donbeo/Applications/spyder-ide-3.4dev/spyderlib/plugins/ipythonconsole.py", line 898, in kernel_and_frontend_match
profile='default')
File "/usr/lib/python2.7/dist-packages/IPython/kernel/connect.py", line 273, in get_connection_info
info = json.loads(info)
File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

最佳答案

Spyder 的开发版本支持连接到远程 IPython 内核(可以是 IPython 笔记本的内核)。该功能有望在几周后成为 Spyder 下一个小版本 2.3.1 的一部分。您可以通过从源代码运行 Spyder 来使用它。

以下是最近合并的相应拉取请求的链接:Spyder Pull Request .

编辑:关于您的编辑(解码连接信息文件时出错)。您的连接文件似乎不是有效的 json。能给我们一下内容吗?通常,它应该看起来像这样:

{
"stdin_port": 59658,
"ip": "your remote server ip",
"control_port": 61601,
"hb_port": 43475,
"signature_scheme": "hmac-sha256",
"key": "333b4408-49f8-4966-a61a-a9e64b1b29e5",
"shell_port": 52767,
"transport": "tcp",
"iopub_port": 57661
}

关于python - spyder 和远程 ssh python 解释器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25525041/

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