Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to accept connections for ipython from other computers?

I run ipython 0.12.1 on Ubuntu 12.04. You can run it in browser using notebook interface by running:

ipython notebook --pylab 

Configuration files can be found in ~/.config/ipython/profile_default/. It seems that connection parameters for every kernel is placed in ~/.config/ipython/profile_default/security/kernel-4e424cf4-ba44-441a-824c-c6bce727e585.json. Here is the content of this file (new files are created as you start new kernels):

{   "stdin_port": 54204,    "ip": "127.0.0.1",    "hb_port": 58090,    "key": "2a105dd9-26c5-40c6-901f-a72254d59876",    "shell_port": 52155,    "iopub_port": 42228 } 

It's rather self-explanatory but how can I set a server that would have a permanent configuration, so I can use notebook interface from other computers in the LAN?

like image 245
enedene Avatar asked May 10 '12 16:05

enedene


People also ask

How do I access my jupyter notebook from another computer?

Go to http://localhost:9999 . You should be able to select your notebook and you'll be good to go. Show activity on this post. you can run jupyter notebook --no-browser --ip="<remote server ip>" on your remote machine terminal.

How do I import IPython?

No more typing “import pandas as pd” 10 times a dayCreate a folder called startup if it's not already there. Add a new Python file called start.py. Put your favorite imports in this file. Launch IPython or a Jupyter Notebook and your favorite libraries will be automatically loaded every time!


1 Answers

If you are using an old version of the notebook, the following could still apply. For new versions see the other answers below.


Relevant section of the IPython docs

The Notebook server listens on localhost by default. If you want it to be visible to all machines on your LAN, simply instruct it to listen on all interfaces:

ipython notebook --ip='*' 

Or a specific IP visible to other machines:

ipython notebook --ip=192.168.0.123 

Depending on your environment, it is probably a good idea to enable HTTPS and a password when listening on external interfaces.

If you plan on serving publicly a lot, then it's a also good idea to create an IPython profile (e.g. ipython profile create nbserver) and edit the config accordingly, so all you need to do is:

ipython notebook --profile nbserver 

To load all your ip/port/ssl/password settings.

like image 168
minrk Avatar answered Oct 01 '22 16:10

minrk