centos7 安装jupyter

1、基本包安装

1
2
3
4
yum update -y
yum install python-pip -y
yum install bzip2 -y
yum groupinstall "Development Tools" -y

  由于服务器的生产环境的packages较多,版本也不一致,所以需要设置虚拟环境,具体操作参照 https://www.cnblogs.com/QiuPing-blog/p/16088424.html

  安装IPython、jupyter和Notebook

1
pip install ipython jupyter notebook

 

2、配置jupyter

   生成jupyter的配置文件

1
2
3
jupyter notebook --generate-config
 
#生成的config file在/root/.jupyter/jupyter_notebook_config.py

  生成加密密码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#当前版本python3
python -c "import IPython; print(IPython.lib.passwd())"
 
#输入两次密码后保存密文密码:
sha1:ddd78df8d7fqe7f8663jk3jk9
 
#生成jupyter 默认配置文件并修改:
jupyter notebook --generate-config --allow-root
 
#修改配置文件
vim /root/.jupyter/jupyter_notebook_config.py
 
c.NotebookApp.ip="*"
c.NotebookApp.allow_root=True
c.NotebookApp.open_browser=False
c.NotebookApp.port=8888
#密文密码粘贴如下
c.NotebookApp.password=u'sha1:ddd78df8d7fqe7f8663jk3jk9'
c.ContentsManager.root_dir='/data/jupyter/root'

  

3、运行jupyter

1
nohup jupyter notebook > /data/jupyter/jupyter.log 2>&1 &

  可根据需求配置为systemctl 服务,具体操作请参照 https://www.cnblogs.com/QiuPing-blog/p/16055625.html

 

posted @   QiuPing  阅读(460)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
点击右上角即可分享
微信分享提示