0
点赞
收藏
分享

微信扫一扫

服务器启动 jupyter notebook


一、简单使用启动方法

启动脚本​​startup_jupyter.sh​​ 内容如下:

cat > startup_jupyter.sh <<"EOF"
#!/usr/bin/bash
echo -e '\033[32m======= start ==========\033[0m'
nohup jupyter notebook --no-browser --port=8888 --ip=* --allow-root > /home/wangsp/jupyter.log 2>&1 &
sleep 1
echo
ip=`ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|grep 192.168.140|awk '{print $2}'|tr -d "addr:"`
text=`cat jupyter.log | awk 'END {print}'`
echo "复制如下地址到浏览器即可使用"
echo ""
echo ${text/(localhost.localdomain or 127.0.0.1)/$ip}
echo ""
echo "done!"
EOF

关闭脚本​​shutdown_jupyter.sh.sh​​ 内容如下:

#!/usr/bin/bash
ps -ef|grep jupyter |grep -v grep |awk '{print $2}'|xargs kill -9
echo -e '\033[32m======= done! ==========\033[0m'

二、生成配置文件启动方法

  1. 输入cmd命令​​jupyter notebook --generate-config​
  2. 根据文件生成路径找到generate-config文件
    ​​​../.jupyter/jupyter_notebook_config.py​
  3. 使用搜索功能根据情况修改文件



举报

相关推荐

0 条评论