jupyter notebook更换主题配色及自动补全(转载)

转载自怎么安装Jupyter Notebook主题皮肤并设置教程
jupyter notebook使用技巧(1):更换主题 - 简书

转载请在文章起始处注明出处

jupyter notebook默认的主题为白色背景,长期使用眼睛差点亮瞎,正好看到可以更换主题,想来可以换个保护下视力。

打开cmder(点我点我)(比cmd更友好,墙裂推荐),使用pip安装(至于为啥conda不能安装,我也不太清楚,还望知道的大佬告知下)Github上大神提供的包jupyterthemes(点我点我)

1、jupyterthemes安装

安装之前请先将pip升级到最新。

python -m pip install --upgrade pip

如果下载比较卡,可以临时改用国内源,即在命令结尾加上-i https://pypi.tuna.tsinghua.edu.cn/simple,后续安装都可以。

python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple

安装jupyterthemes。

pip install jupyterthemes -i https://pypi.tuna.tsinghua.edu.cn/simple

错误信息:

Cannot uninstall 'jupyter-client'. It is a distutils installed project and thus we cannot accurate ly determine which files belong to it which would lead to only a partial uninstall.

百度下发现有大佬遇到过此类问题(原文点这里),解决办法直接到anaconda安装目录下,搜索对应包的名字,删掉对应文件夹.egg-info文件即可。完美解决!

Successfully installed jupyterthemes-0.20.0

2、选择主题

通过以下命令查看主题种类。

jt -l

有下面主题可以选择。


我选择monikai:

jt -t monokai

打开jupyter notebook,主题效果如下:



如果不喜欢,可以用上述命令更换其他主题。

如果还是喜欢原生的,命令如下:

jt -r

3、设置主题参数

jt  -t oceans16 -f consolamono -tf ptmono -ofs 10 -nfs 13 -tfs 13 -fs 12 -T -N -lineh 140

效果如下:


更多参数设置,请参考jupyterthemes参数设置说明:

4、小彩蛋

设置好主题后,开开心心去打开ipynb文件,然后。。



更新jupyter notebook后完美解决。

conda update jupyter notebook

至此,设置完成,开心撸代码去。

自动补全

转载自 https://www.cnblogs.com/tianqizhi/p/10612976.html

首先安装 nbextensions:

pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user

然后安装 nbextensions_configurator:

pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值