更改jupyter notebook主题

2025-07-14 13:02:01

1、下载好主题包之后,在命令提示符中输入pip install --upgrade jupyterthemes,安装主题包

2、安装好之后,在命令提莲镘拎扇示符中输入jt -l,可以查看主题:Available Themes:chesterishgrade3monokaioceans1鲂番黟谊6onedorksolarizeddsolarizedl那就继续执行命令: jt -t 主题名称(主题名称可以选chesterish....)这样就可以修改主题了,这是后打开jupyter notebook就可以看到修改后的主题了

更改jupyter notebook主题

3、当然输入jt -l之后也可能报错,在命令提示符的最后一行会显示:UnicodeDecodeError: 'gbk' codec can't decode byte 0x8b in position 41271: illegal multibyte sequence。。。这可以通过下面介绍的方法修改程序来改正:

4、第一步、修改stylefx.py文件位置:D:\Anaconda3\Lib\site-packages\jupyterthemes (不同的电脑,路径不一样,具体看安装anaconda的位置)用jupyter notebook 打开stylefx.py,修改代码

更改jupyter notebook主题
更改jupyter notebook主题

5、第二步,修改lexer.py文件文件地址:D:\Anaconda3\Lib\site-packages\lesscpy\lessc (不同的电脑,路径不一样,具体看安装anaconda的位置)使用jupyter notebook打开文件lexer.py

更改jupyter notebook主题
更改jupyter notebook主题

6、最后就可以在命令提示符中输入:jt -t 主题名称 来修改jupyter notebook的主题了 ,例如输入 jt -tchesterish,打开jupyter notebook之后就可以看到相应的主题了,见下图

更改jupyter notebook主题
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢