Centos7安装jupyter notebook

###安装python3
#####查看当前python版本

[root@VM-0-12-centos ~]# python -V
Python 2.7.5
安装python3以及检查python3的版本
yum install python3
python3 -V
安装jupyter notebook
pip3 install jupyter

生成配置文件

jupyter notebook --generate-config
Writing default config to: /root/.jupyter/jupyter_notebook_config.py

生成密码,用刚装好的python3就可以了(可能是版本问题,尝试不能成功)

from notebook.auth import passwd
passwd()

命令行生成密码:

jupyter notebook password 
#[NotebookPasswordApp] Wrote hashed password to /root/.jupyter/jupyter_notebook_c                     onfig.json
再次前台启动就会出现哈希密码

最后是修改一下配置文件
password 就是刚才用命令行生成的哈希密码

vim /root/.jupyter/jupyter_notebook_config.py
c.NotebookApp.password = 'sha1:8$E18FYIYkGfwYK+270oBdgA$gNYatshZbw8WvcoiwjPKMw'
c.NotebookApp.port = 8888
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.notebook_dir = '/jupyter_notebook'
启动jupyter notebook

前台启动:

jupyter notebook --allow-root

后台启动:

#默认将日志写到当前目录的nohup.out中
nohup jupyter notebook --allow-root &

#不想输出日志可将日志输出到“黑洞”(同时也可将null指定为输出文件)
nohup jupyter notebook --allow-root >/dev/null 2>&1 &

使用后台启动想退出时:
想要退出的话可以查询jupyter notebook占用了哪个进程

ps -aux | grep jupyter

或者是查询端口号8888被哪个进程占用了

netstat -tunlp|grep 8888

然后把找到的进程kill掉就可以了

kill 33650
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值