进入需要下载jupyter的环境
pip install jupyter notebook
生成对应的jupyter配置文件
jupyter notebook --generate-config
进入ipython编译环境
ipython
from jupyter_server.auth import passwd
passwd()
然后输入密码
Enter password: ******
Verify password: ******
Out [2]: 'sha1:...'
会出现一个加密密码,复制这个加密密码然后到外面文件夹中找到.jupyter,找个文档保存下来,后面用到
进去找到jupyter_notebook_config.py
把下面代码加上
c = get_config() #noqa
# Nginx访问时会出现跨域访问,需要在这里允许
c.NotebookApp.allow_origin = '*'
# 禁止随意修改密码
c.NotebookApp.allow_password_change = False
# 是否允许远程访问
c.NotebookApp.allow_remote_access = True
c.ServerApp.open_browser = False
# IP
c.NotebookApp.ip = '0.0.0.0'
# 端口
c.NotebookApp.port = 8888
# 工作目录
c.NotebookApp.notebook_dir = '/usr/local/bin/jupyter'
# 启动Jupyter Notebook之后是否打开浏览器
c.NotebookApp.open_browser = False
# 客户端打开Jupyter Notebook的密码哈希值
c.NotebookApp.password = ’argon2: ‘ !!!!!这里换成你刚刚复制的代码
启动jupyter
输入jupyter notebook启动
将上面的地址复制到浏览器中,其中127.0.0.1换成你linux的,然后进入网站输入你刚刚设置的密码即可。
好了结束