1. 环境准备
conda create -n jupyter python=3.10
2. jupyter 配置
生成配置文件
jupyter notebook --generate-config
vim .jupyter/jupyter_notebook_config.py
c.NotebookApp.notebook_dir = '/data/webapp/python/jupyter'
c.NotebookApp.ip='*'
c.NotebookApp.open_browser = False
c.NotebookApp.port=8089
生成密码:
jupyter notebook password
3. 启动
#!/bin/bash
source /data/server/miniconda3/etc/profile.d/conda.sh
conda activate jupyter
start(){
cmd="jupyter notebook --allow-root"
nohup $cmd >/data/logs/jupyter.log 2>&1 &
}
stop(){
ps -ef | awk '/jupyter-notebook/ && !/awk/{print $2}' | xargs kill -9
}
case $1 in
start )
echo "启动jupyter"
start
;;
stop )
echo "停止jupyter"
stop
;;
restart )
echo "重启jupyter"
stop
start
esac
855

被折叠的 条评论
为什么被折叠?



