jupyter nootbook
在自己的python环境中安装 jupyter nootbook
pip install jupyter
生成配置文件
jupyter notebook --generate-config
控制台返回.jupyter/jupyter_notebook_config.py的具体地址
打开jupyter_notebook_config.py
control+f搜索c.NotebookApp.notebook_dir = ''
在‘’中填入自己的默认工作空间
保存
使用命令jupyter notebook
启动
jupyter lab
在自己的python环境中安装 jupyter lab
pip install jupyterlab
生成配置文件
jupyter lab --generate-config
控制台返回.jupyter/jupyter_lab_config.py的具体地址
打开jupyter_lab_config.py
control+f搜索c.ServerApp.root_dir = ''
在‘’中填入自己的默认工作空间
保存
使用命令jupyter lab
启动
一个cell只输出一个的解决办法
临时
1.通过添加如下代码
在代码最上方cell添加:
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
永久
2.设置所有的Jupyter实例(Notebook和Console)
(1)创建~/.ipython/profile_default/ipython_config.py
打开mac的终端输入如下指令:
vim ~/.ipython/profile_default/ipython_config.py
(2)按i键进入编辑模式,输入如下代码:
c = get_config()
c.InteractiveShell.ast_node_interactivity = "all"
按 esc 键后,输入":wq!" ,即可保存并退出。
(3)输入如下指令使上述代码生效:
source ~/.ipython/profile_default/ipython_config.py