在虚拟机的python中安装配置Jupyter Notebook

一、生成或找到配置文件

复制代码
jupyter notebook --generate-config

二、配置文件内容

jupyter_notebook_config.py文件中,你需要进行以下配置:

设置允许访问的IP地址

复制代码
c.NotebookApp.ip = '*'

设置密码

复制代码
c.NotebookApp.password = 'sha1:xxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'  # 替换为你的哈希值

这个密码通过执行jupyter notebook password命令,返回一个json文件,里面有这个密码,复制过来

关闭自动打开浏览器

复制代码
c.NotebookApp.open_browser = False

设置端口:(不设也行)

复制代码
c.NotebookApp.port = 8888

允许远程访问

复制代码
c.NotebookApp.allow_remote_access = True

修改完直接保存就可以了

执行jupyter notebook --allow-root启动成功

在客户端上访问Jupyter Notebook

http://192.168.1.100:8888

相关推荐
Warson_L1 天前
Python `Annotated` 与 LangGraph Reducer 学习笔记
python
韩师傅1 天前
海天线算法的前世今生
python·计算机视觉
韩师傅1 天前
当你的甲方设备过烂,要如何快速出效果?
python·计算机视觉
Warson_L1 天前
LangGraph的MessageState and HumanMessage
python
韩师傅1 天前
当你的甲方吐槽天空不够蓝,你应该如何应对
python·计算机视觉
Warson_L1 天前
python的类&继承
python
Warson_L1 天前
类型标注/type annotation
python
ThreeS1 天前
手搓MiniVLA全实战教程-一步一步用pytorch解释原理与思路
人工智能·python
金銀銅鐵1 天前
[Python] 模 n 乘法的逆元计算器
python·数学·游戏