python --version
yum -y install python-pip
pip install --upgrade pip
yum -y groupinstall "Development Tools" yum -y install python-devel
pip install virtualenv
virtualenv venv source venv/bin/activate
pip install jupyter
mkdir /data/jupyter
cd /data/jupyter
mkdir /data/jupyter/root
python -c "import IPython;print IPython.lib.passwd()"
'sha1:...'
的密文,咱们接下来将会用到它。
--generate-config
来参数生成默认配置文件:
jupyter notebook --generate-config --allow-root
/root/.jupyter/
目录下,能够
点此编辑配置。
c.NotebookApp.ip = '*' c.NotebookApp.allow_root = True c.NotebookApp.open_browser = False c.NotebookApp.port = 8888 c.NotebookApp.password = u'刚才生成的密文(sha:...)' c.ContentsManager.root_dir = '/data/jupyter/root'
c.NotebookApp.password
请将上一步中密文填入此项,包括 sha: 部分。Nginx
将服务代理到 80 或 443 端口。
【首页】
首先须要输入前面步骤中设置的密码。【 new 】
,选择 Python2 新建一个 notebook,这时跳转至编辑界面。Untitled.ipynb
文件,这就是咱们刚刚新建的 Notebook 文件。咱们创建的全部 Notebook 都将默认以该类型的文件格式保存。jupyter notebook
命令启动 Jupyter 的方式在链接断开时将会中断,因此咱们须要让 Jupyter 服务在后台常驻。
Ctrl + C
并输入
y
中止 Jupyter 服务,而后执行如下命令:
nohup jupyter notebook > /data/jupyter/jupyter.log 2>&1 &
cd /data/jupyter/root cp Untitled.ipynb first.ipynb cp Untitled.ipynb matplotlib.ipynb cp Untitled.ipynb tensorflow.ipynb rm -f Untitled.ipynb