点击查看JupyterLab官方文档
Jupyterlab
修改配置文件
- 修改 JupyterLab 配置文件:
jupyter lab --generate-config
- 修改端口(默认是8888端口):
c.NotebookApp.port = 8889
- 自定义文件夹:
c.NotebookApp.notebook_dir = 'D:\jupyter'
Jupyter Notebook
- 在同一个代码块设置多个输出
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity='all'
插件扩展
conda install -c conda-forge jupyter_contrib_nbextensions
conda install -c conda-forge jupyter_nbextensions_configurator
在notebook切换环境
为了让Jupyter Notebook支持虚拟运行环境(注意,虚拟环境中需要安装jupyter notebook),需要在Anaconda里安装一个插件
conda install nb_conda
在指定文件夹打开notebook
- 打开Anaconda Prompt;
- 转至指定盘,比如D盘,输入
D:
,回车; - 输入
cd path
,回车,其中path
为指定的文件夹路径,比如D:\Works\project
- 输入
jupyter notebook
,回车
若是在指定盘打开notebook,可忽略步骤3