# 下载
pip install -i https://pypi.douban.com/simple jupyter
# 生成配置文件
jupyter notebook --generate-config --allow-root
# 配置文件生成在:~/.jupyter/jupyter_notebook_config.py
# 设置密码
jupyter notebook password
# 修改配置文件
# 设置监听地址,一般改为当前主机的ip
sed -ie "s/#c.NotebookApp.ip = 'localhost'/c.NotebookApp.ip = 'IP地址'/g" ~/.jupyter/jupyter_notebook_config.py
# 设置监听端口
sed -ie 's/#c.NotebookApp.port = 8888/c.NotebookApp.port = 8000/g' ~/.jupyter/jupyter_notebook_config.py
# 禁用自动打开浏览器
sed -ie 's/#c.NotebookApp.open_browser = True/c.NotebookApp.open_browser = False/g' ~/.jupyter/jupyter_notebook_config.py
# 启动
jupyter notebook --ip=0.0.0.0 --allow-root
# 注意添加--ip=0.0.0.0,否则访问会出现问题
# 此时打开浏览器,输入 Jupyter服务器的ip:8000
# 进入登陆页面后,输入设置的密码即可登陆
linux下配置jupyter notebook
最新推荐文章于 2024-04-16 08:15:00 发布