I want to start IPython on raspberry pi and connect it from the outside to use it. Work log to realize this function.
By the way, the usage environment is as follows.
$ python --version
Python 2.7.9
sudo apt-get install ipython ipython-notebook
sudo apt-get install python-matplotlib python-scipy
sudo apt-get install python-pandas python-sympy
ipython notebook
This completes the installation of IPython itself. Next, build an environment that can be connected from the outside.
sudo pip install jupyter
Installation of Jupyter is now OK.
Create a configuration file for the external connection environment.
First, start ipython and set the password for Jupyter login.
$ ipython
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password: <Enter password>
Verify password: <Re-enter password>
Out[2]: 'sha1:<Hashed password>'
Make a copy of the hashed password.
Next, create a configuration file.
$ mkdir ~/.jupyter
$ vim ~/.jupyter/jupyter_notebook_config.py
~/.jupyter/jupyter_notebook_config.py
c = get_config()
#Allows what is drawn with matplotlib to be displayed on notebook
c.IPKernelApp.pylab = 'inline'
#Allow connections from all IPs
c.NotebookApp.ip = '*'
#Login password for IPython notebook
c.NotebookApp.password = 'sha1:<Hashed password>'
#Setting whether to start the browser at startup(The default is to start)
c.NotebookApp.open_browser = False
#Port specification(The default is 8888)
c.NotebookApp.port = <Connection port>
The setting is completed. Check the operation.
jupyter notebook
Connect to http: // <ip address>: <connection port>
from the browser of the external machine.
You will be asked for a password, so enter the password you set above to log in.
Recommended Posts