2014-08-27 273 views
1

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

spyder是否支持远程ssh intepreter?如果不是什么是可能的免费选择?

编辑: 随着spyder的新版本,它似乎有可能连接到远程外壳。 但是当我尝试连接我收到此错误

>>> 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 

回答

2

的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 
} 
+0

您认为这个功能将在几周内被包含在pip版本中吗? – Donbeo 2014-08-29 09:52:49

+0

@Donbeo没有确切的日期,但从源代码运行spyder非常简单:安装mercurial,克隆存储库并运行python bootstrap.py。 – Quant 2014-08-29 13:22:00

+0

如果您认为这是对您问题的正确答案,请验证答案。 – Quant 2014-08-29 15:49:03