jupyter安装与使用

1、检查python版本

python -V
pip -V

2、设置pip源

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config list

# 非https源,须加信任
pip config set install.trusted-host xxx.com

3、安装 & 启动 jupterlab 

# 安装
pip install jupyterlab
# 生成配置文件
jupyter lab --generate-config
# 编辑配置文件 (上一命令生成,文件名:~/.jupyter/jupyter_lab_config.py)
c.ServerApp.ip = '*'
c.ServerApp.allow_root = True
c.ServerApp.port = 8888
c.ServerApp.allow_remote_access = True #允许远程连接
c.ServerApp.root_dir = 'your directory' #进入Jupyter的默认路径
# 设置密码 jupyter lab password
# 启动
jupyter lab

4、安装 & 启动 notebook

# 安装
pip install notebook
# 生成配置文件
jupyter notebook --generate-config
# 编辑配置文件 (上一命令生成,文件名:~/.jupyter/jupyter_notebook_config.py)
c.NotebookApp.ip='*'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888
c.NotebookApp.notebook_dir='your directory' #进入Jupyter的默认路径
# 设置密码
jupyter notebook password
# 启动
jupyter notebook

 

参考:

 官网 https://jupyter.org/install

 知乎 https://zhuanlan.zhihu.com/p/33105153

posted @ 2023-09-26 15:01  Matt_Cheng  阅读(77)  评论(0编辑  收藏  举报