Centos7 安装部署jupyter

安装python3
查看当前python版本

[root@iz1i4qd6oynml0z /]# 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()

然后会得到一个字符串,‘sha1:18a311f2bceb:f7bebfa7a61f7057bc034d9affe750c8b65ead6a’
最后是修改一下配置文件
分别是密码,端口号,允许远程连接,默认打开浏览器,默认路径

vim /root/.jupyter/jupyter_notebook_config.py
c.NotebookApp.password = 'sha1:18a311f2bceb:f7bebfa7a61f7057bc034d9affe750c8b65ead6a'
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命令,然后按一下enter,退出终端的话用exit就可以了,默认会将日志文件输出到当前目录的nohup.out

nohup jupyter notebook --allow-root &

如果不输出日志文件可以把日志文件输出到黑洞

nohup jupyter notebook --allow-root >/dev/null 2>&1 &

想要退出的话可以查询jupyter notebook占用了哪个进程

ps -aux | grep jupyter

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

netstat -tunlp|grep 8888

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

kill -9   pid  (pid代表进程id)
  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

JTZ001

你的鼓励是我创作的最大动力?

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值