[IPython-dev] Remote kernels works BUT local kernels does not work.

Ruslan Korniichuk paad.ruslan.korniichuk at gmail.com
Fri Apr 17 16:47:10 EDT 2015


Hi all,
All history of this subject is available HERE:
http://goo.gl/WuMfeJ

I am trying to realize (see below) the algorithm which propose Matthias and
have 1 problem and 2 important questions:
1. I can work with remote kernels, but because I changed c.KernelManager.ip
in ipython_notebook_config.py Jupyter Notebook can't work with local
kernels. Please tell me ideas how I can use, in one Jupyter Notebook, local
and remote kernels (change kernel from local to remote). Maybe I can change
IP address not only in ipython_notebook_config.py?
2. I must hack ~/IPython/kernel/manager.py and it's VERY bad idea because
after Jupyter Notebook from ver. 4.0 to to ver. 40.0 was big fat trouble:)
How I can change configuration that Jyputer Notebook approve and launch a
kernel on a remote PC.
3. Where I can read information about new architecture of Jupyter, for
example, I tried find manager.py file on Jupyter resources but failed:(
4. What about python2 kernel if I installed Jyputer Notebook like this:
$ sudo apt-get install python3-pip
$ ipytsudo pip3 install "ipython[notebook]"
Is it possible? I tried change kernel.json (from /usr/bin/python3 to
/usr/bin/python). It is does not work:
ERROR: /usr/bin/python: IPython.kernel.zmq requires pyzmq >= 13;
'IPython.kernel' is a package and cannot be directly executed

Main source HERE:
Jupyter Notebook server ver. 3.1.0-cbccb68
IP adress pc-frontend(local pc): 155.158.129.241
IP adress pc-backend(remote pc): 155.158.129.242

kernel.json:
{
 "language": "python",
 "display_name": "Python 3 Back End",
 "argv": [
  "./remote_kernel.sh",
  "{connection_file}"
 ]
}

remote_kernel.sh:
#! /bin/bash
connection_file=$1
scp $connection_file paad at 155.158.129.242:$connection_file
ssh paad at 155.158.129.242 << EOF
/usr/bin/python3 -m IPython.kernel -f $connection_file --profile-dir
/home/paad/.ipython/profile_default
EOF

ipython_notebook_config.py:
FROM: # c.KernelManager.ip = 'localhost'
TO: c.KernelManager.ip = '155.158.129.242'

~/IPython/kernel/manager.py:
def start_kernel():
    FROM:
    if self.transport == 'tcp' and not is_local_ip(self.ip):
        raise RuntimeError("Can only launch a kernel on a local interface. "
                           "Make sure that the '*_address' attributes are "
                           "configured properly. "
                           "Currently valid addresses are: %s" % local_ips()
                           )
    TO:
    # if self.transport == 'tcp' and not is_local_ip(self.ip):
        # raise RuntimeError("Can only launch a kernel on a local
interface. "
                           # "Make sure that the '*_address' attributes are
"
                           # "configured properly. "
                           # "Currently valid addresses are: %s" %
local_ips()
                           # )

---
Best regards,
Ruslan Korniichuk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150417/d977088a/attachment.html>


More information about the IPython-dev mailing list