简介

IPython NoteBook(jupyter)是一个综合的交互式编程环境,比原本python命令进入的交互式环境要强大很多,总之就是炫酷加实用,浏览器中写Python代码,访问源端linux服务器。

官网链接


部署 [请点我](http://www.linuxdiyf.com/linux/22884.html)

  1、安装依赖
安装pip:
yum install epel-release
yum install python-pip python-devel
安装开发工具集:
yum groupinstall 'Development Tools' 2、安装配置Jupyter
pip install jupyter
运行:
jupyter notebook
Jupyter安装成功,但是默认配置下只能从本地访问(http://127.0.0.1:8888)。
如果你只在本机使用notebook,那么下一个步可以省了。如果你想把notebook做为公共服务供其它人使用,配置允许远程访问:
生成配置文件:
jupyter notebook --generate-config
生成的配置文件位于 ~/.jupyter/jupyter_notebook_config.py
生成自签名SSL证书:
cd ~/.jupyter
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout notebook_cert.key -out notebook_cert.pem
生成一个密码hash:
python -c "import IPython;print(IPython.lib.passwd())"
vim ~/jupyter/jupyter_notebook_config.py
c = get_config()
c.NotebookApp.certfile = u'/home/xxxx/.jupyter/notebook_cert.pem'
c.NotebookApp.keyfile = u'/home/xxxx/.jupyter/notebook_cert.key'
c.NotebookApp.password = u'sha1:991ec9cd2f39:522598e19891bab1ecaa3a9072e71f45811af9f2'
c.NotebookApp.ip = '*'
c.NotebookApp.port = 8080
c.NotebookApp.open_browser = False
再次启动Notebook:
jupyter notebook
如果你开启了防火墙,配置打开8080端口。
使用浏览器访问:https://your_domain_or_IP:8080

截图

Python交互式编辑器ipthon notebook jupyter-LMLPHP


操作gif

Python交互式编辑器ipthon notebook jupyter-LMLPHP


使用快捷键

Python交互式编辑器ipthon notebook jupyter-LMLPHP

05-11 12:59