ipython notebook is a browser-based python data analysis tool with strong interaction and rich text display effect. Jupyter is an upgraded version of it, its installation is also very convenient, generally Anaconda installation package will come with it. After installation, enter jupyter notebook directly and use it in the browser. However, it can only be accessed locally by default. If you want to install it on the server and then access it locally and remotely, you need to configure the following:
1. Install ipython and jupyter
pip install ipython
pip install jupyter
Second, generate configuration files
jupyter notebook --generate-config
Three, generate a password
ipython
Python 3.5.1 (default, Oct 21 2016, 21:37:19)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
from notebook.auth import passwd
passwd()
display:
Enter password:
Verify password:
Fourth, modify the default configuration file
vi /home/allen/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip='*' #设置访问notebook的ip,*表示所有IP,这里设置ip为都可访问
c.NotebookApp.password = u'sha1:5df252f58b7f:bf65d53125bb36c085162b3780377f66d73972d1' #填写刚刚生成的密文
c.NotebookApp.open_browser = False # 禁止notebook启动时自动打开浏览器(在linux服务器一般都是ssh命令行访问,没有图形界面的。所以,启动也没啥用)
c.NotebookApp.port =8800 #指定访问的端口,默认是8888
Five, start jupyter notebook
error:
Firewall
sudo /sbin/iptables -I INPUT -p tcp --dport 8800 -j ACCEPT