jupyter notebook安装配置

安装

pip install jupyter

生成配置文件

jupyter notebook --generate-config

生成密码jupyter notebook安装配置_第1张图片

修改配置文件

c.NotebookApp.allow_remote_access = True
c.NotebookApp.base_url = '/jupyter'
c.NotebookApp.enable_mathjax = True
#如果需要其他外网直接访问,下面ip设置为*
c.NotebookApp.ip = '127.0.0.1'
c.NotebookApp.notebook_dir = '/your/ipython/dir'
c.NotebookApp.open_browser = False
c.NotebookApp.password = 'sha1:c12803f3ed1c:cd79647ab4a16e3bd7c8b6c576cbdf13ab803785'
c.NotebookApp.port = 8889

nginx转发配置

修改nginx.conf,添加如下内容:

location /jupyter/ {
	proxy_pass http://127.0.0.1:8889/jupyter/;
	proxy_set_header host    "127.0.0.1:8889";
	proxy_set_header origin  "http://127.0.0.1:8889/jupyter/";
	proxy_set_header X-Real-IP "127.0.0.1";

	# WebSocket proxying
	proxy_http_version 1.1;
	proxy_set_header Upgrade $http_upgrade;
	proxy_set_header Connection "upgrade";
}

你可能感兴趣的:(python,ipython,jupyter,jupyter,notebook)