我有一个ubuntu服务器,我可以使用ssh连接运行python解释器。 我想将解释器链接到我的IDE之一。
spyder是否支持远程ssh intepreter?如果不是什么可能的免费替代品?
编辑: 使用新版本的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
答案 0 :(得分:2)
Spyder的开发版支持与远程IPython内核的连接(它可能是IPython笔记本之一)。这个功能将成为Spyder 2.3.1的下一个次要版本的一部分,希望在几周内完成。您可以通过从源代码运行Spyder来使用它。
以下是最近合并的相应Pull Request的链接: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
}