一、准备环境
- Centos 7.6
- Python 3.7
- Nginx
注意:Jupyter部署是在非root用户下(这里是abc用户)
二、步骤
1. 安装
pip3 install jupyter
安装完成可以先测试:
jupyter notebook --no-browser
2. 生成配置文件
生成配置文件:
jupyter-notebook --generate-config
配置文件是默认是生成在当前用户家目录下的.jupyter目录的
我这里的配置文件地址
/home/abc/.jupyter/jupyter_notebook_config.py
注意:生成配置文件的时候可能会报错:
PermissionError: [Errno 13] Permission denied: '/home/abc/.jupyter'
原因:这是因为当前用户权限不足,无法创建/home/abc/.jupyter
解决方式:需要在root用户下
在/home/abc/下新建.jupyter目录,并且赋予当前用户该目录的操作权限