jupyter默认工作空间配置与cell输出设置

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值