Donbeo
Donbeo

Reputation: 17617

spyder and remote ssh python intepreter

I have an ubuntu server where I can run a python interpreter using ssh connection. I would like to link the interpreter to one of my IDE.

Does spyder support remote ssh intepreter? If not what is a possible free alternative?

Edit: With the new version of spyder it seems to be possible to connect to a remote shell. but when I try to connect I receive this error

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

Upvotes: 1

Views: 5271

Answers (1)

Quant
Quant

Reputation: 1645

The development version of Spyder supports the connection to a remote IPython kernel (it could be the one of an IPython notebook). This is feature will be part of the next minor release of Spyder, 2.3.1, in a couple of weeks hopefully. You can use it already by running Spyder from source.

Here is a link to the corresponding Pull Request that was merged recently: Spyder Pull Request.

EDIT: regarding your edit (error decoding the connection info file). It seems that your connection file is not valid json. Could you give us the content? Normally, it should look like this:

{
  "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
}

Upvotes: 2

Related Questions