centos jupyter 安装_Centos7安装jupyter notebook

安装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 20627

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值