1、windows系统

(1)下载到本地(使用git bash命令行界面)

git clone https://github.com/dunovank/jupyter-themes 

(2)Install with pip

# install jupyterthemes
pip install jupyterthemes # upgrade to latest version
pip install --upgrade jupyterthemes

(3)以上安装完成后,可以尝试切换主题了

# list available themes
# onedork | grade3 | oceans16 | chesterish | monokai | solarizedl | solarizedd
jt -l
Available Themes:
chesterish
grade3
gruvboxd
gruvboxl
monokai
oceans16
onedork
solarizedd
solarizedl
# select theme...
jt -t chesterish

通常jt -t chesterish执行没任何输出说明没问题,但是偶尔也会有报错 
比如:类似gbk编码方式读文件出错(详细报错信息略)

解决方法:很简单–报错信息会告诉你哪个py文件出问题了,就在对应的那一行,增加编码格式(UTF-8)即可

2、linux系统

(1)linux系统有网
  • 直接下载(前提安装了git命令)
git clone https://github.com/dunovank/jupyter-themes 
  • 安装方式同上面windows的

    安装过程基本不会出问题,通常都是网络问题,参考下面完全没网的情况

    • 需要注意的是:linux执行jt -l可能报错如下:
[root@djt_37_152 jupyterthemes-0.18.3]# jt -l
-bash: jt: command not found
# 需要配置环境变量
[root@djt_37_152 jupyterthemes-0.18.3]# vim /etc/profile
#......在文件最后增加下面一行即可........
export PATH=$PATH:/usr/local/python27/bin:/root/anaconda2/bin
# 即加上jt命令所在的bin目录 # source或. 均可使环境变量生效如下
[root@djt_37_152 jupyterthemes-0.18.3]# . /etc/profile
[root@djt_37_152 jupyterthemes-0.18.3]# jt -l
Available Themes:
chesterish
grade3
gruvboxd
gruvboxl
monokai
oceans16
onedork
solarizedd
solarizedl
(2)linux系统没网
  • 下载 jupyterthemes-0.18.3.tar.gz(曲线救国)

    windows(或其他可联网的linux机器)下载,压缩后rz上传到linux服务器XXX.XX.XX.XXX

  • 解压后进入目录

[root@djt_37_152 wj]# tar -zxvf jupyterthemes-0.18.3.tar.gz
[root@djt_37_152 wj]# cd jupyterthemes-0.18.3
[root@djt_37_152 jupyterthemes-0.18.3]# pwd
/search/autotest/wj/packages/jupyterthemes-0.18.3
[root@djt_37_152 jupyterthemes-0.18.3]# ll
؜ԃ 36684
drwxr-xr-x 9 1000 ops 4096 1Ղ 25 22:45 backports.functools_lru_cache-1.4
-rw-r--r-- 1 root root 6927 1Ղ 25 22:43 backports.functools_lru_cache-1.4.tar.gz
drwxr-xr-x 4 root root 41 1Ղ 25 17:24 build
drwxr-xr-x 7 1000 ops 4096 1Ղ 25 22:46 cycler-0.10.0
-rw-r--r-- 1 root root 16553 1Ղ 25 22:45 cycler-0.10.0.tar.gz
drwxrwxr-x 8 1000 ops 4096 1Ղ 25 22:48 dateutils-0.6.6
-rw-r--r-- 1 root root 3492 1Ղ 25 22:46 dateutils-0.6.6.tar.gz
drwxr-xr-x 2 root root 43 1Ղ 25 17:24 dist
drwxr-xr-x 5 501 games 95 1Ղ 4 06:47 jupyterthemes
drwxr-xr-x 2 501 games 128 1Ղ 4 06:47 jupyterthemes.egg-info
-rw-r--r-- 1 501 games 1091 6Ղ 25 2016 LICENSE.txt
-rw-r--r-- 1 501 games 235 7Ղ 26 2017 MANIFEST.in
drwxr-xr-x 14 1000 ops 4096 1Ղ 25 17:42 matplotlib-2.1.2
-rw-r--r-- 1 root root 36238363 1Ղ 25 17:28 matplotlib-2.1.2.tar.gz
-rw-r--r-- 1 501 games 911 1Ղ 4 06:47 PKG-INFO
drwxrwxrwx 8 root root 4096 1Ղ 25 22:42 pyparsing-2.2.0
-rw-r--r-- 1 root root 1232522 1Ղ 25 22:42 pyparsing-2.2.0.tar.gz
-rw-r--r-- 1 501 games 9455 9Ղ 12 09:24 README.md
-rw-r--r-- 1 501 games 62 1Ղ 4 06:43 requirements.txt
-rw-r--r-- 1 501 games 108 1Ղ 4 06:47 setup.cfg
-rw-r--r-- 1 501 games 2884 1Ղ 25 22:35 setup.py # 很多文件,其中优先看一下requirements.txt
[root@djt_37_152 jupyterthemes-0.18.3]# cat requirements.txt
jupyter_core
ipython>=5.4.1
matplotlib>=1.4.3
lesscpy>=0.11.2 #可以看到需要的依赖是这些,不妨直接执行python setup.py install试试
[root@djt_37_152 jupyterthemes-0.18.3]# python setup.py install
# (不出意外应该会有很多报错~~~基本都是缺少XXX moduel)
# 对应下载(曲线救国后rz上传)XXX moduel的xxx.tar.gz文件解压后python setup.py install
# 如果安装成功会有success,不成功缺什么下什么,进入循环模式。
# 然后回到jupyterthemes-0.18.3目录尝试继续执行python setup.py install
# 如果安装成功会有success,不成功缺什么下什么,进入循环模式。
# 反正直到成功为止。

万一最后一直不成功(看不到success)呢?比如:我就遇到matplotlib一直install不成功,怎么办? 
我的方法是(放大招):修改setup.py文件。比如,修改如下

[root@djt_37_152 jupyterthemes-0.18.3]# vim setup.py
#把之前install不成功的都注释掉。
#install_requires = ['jupyter_core', 'ipython>=5.4.1', 'matplotlib>=1.4.3', 'lesscpy>=0.11.2']
install_requires = ['jupyter_core', 'lesscpy>=0.11.2']
# 然后回到jupyterthemes-0.18.3目录尝试继续执行python setup.py install
# 会发现可以看到success了。

命令行的格式的解释如下表所示:

cl options arg default
Usage help -h --
List Themes -l --
Theme Name to Install -t --
Code Font -f --
Code Font-Size -fs 11
Notebook Font -nf --
Notebook Font Size -nfs 13
Text/MD Cell Font -tf --
Text/MD Cell Fontsize -tfs 13
Pandas DF Fontsize -dfs 9
Output Area Fontsize -ofs 8.5
Mathjax Fontsize (%) -mathfs 100
Intro Page Margins -m auto
Cell Width -cellw 980
Line Height -lineh 170
Cursor Width -cursw 2
Cursor Color -cursc --
Alt Prompt Layout -altp --
Alt Markdown BG Color -altmd --
Alt Output BG Color -altout --
Style Vim NBExt* -vim --
Toolbar Visible -T --
Name & Logo Visible -N --
Reset Default Theme -r --
Force Default Fonts -dfonts --
各种主题展示:
plotting style

markdown/equations

pandas dataframes

command palette

oceans16 syntax

grade3 syntax

onedork syntax

chesterish syntax

 

如何修改Jupyter Notebook的主题的更多相关文章

  1. 修改Jupyter notebook的启动目录

    修改Jupyter notebook的启动目录 1. 在控制台输入以下命令,检查Jupyter notebook的安装目录 jupyter notebook --generate-config ​ 如 ...

  2. 唯一正确的修改Jupyter Notebook默认路径的方法

    唯一正确修改Jupyter Notebook的默认路径 1.按照网上的方法,先修改了快捷方式的起始位置,发现并不能修改默认路径. 2.后来发现“目标”中后面有个参数%USERPROFILE%,它代表的 ...

  3. 修改jupyter notebook的工作路径

    两种方法 一 修改jupyter notebook快捷方式的属性 ①根据下图找到jupyter的快捷方式:jupyter notebook→更多→打开文件位置 ②右键打开属性-将目标一栏中最后的%US ...

  4. 修改Jupyter Notebook默认文件存储路径(已安装Anaconda)

    https://blog.csdn.net/weixin_44799144/article/details/91823079 修改Jupyter Notebook默认文件存储路径首先,安装好Anaco ...

  5. 修改jupyter notebook主题、字体和启动路径

    目录 1.安装主题 2.切换 3.字体 4.启动路径 1.安装主题 window在cmd中输入 pip install --upgrade jupyterthemes 完成后输入查看 jt -l 就提 ...

  6. 更换jupyter notebook风格主题、修改默认工作路径(Ubuntu系统和Win系统)

    默认的风格对代码关键词的颜色提醒很不明显,而且白色背景长久使用非常刺眼,所以考虑更换主题. 在更换途中,发现代码输出行,前几个字符被遮挡显示不出来,找了很久才解决,备忘一些要点. 1:替换主题方法 h ...

  7. 关于 win10 系统中 Anaconda3 中修改 Jupyter Notebook 默认启动目录

    目标: 修改Anaconda3中自带的Jupyter Notebook默认启动目录. 步骤:     1.提前创建好你想要启动位置文件夹.     2.寻找配置文件,"jupyter_not ...

  8. 修改jupyter notebook的默认打开地址

    1)在Anaconda Prompt终端中输入下面命令,查看你的notebook配置文件在哪里: jupyter notebook --generate-config 2)通过搜索关键词:c.Note ...

  9. jupyter notebook设置主题背景,字体和扩展插件

    windows上安装Anaconda (IPython notebook) Anaconda是一个包与环境的管理器,一个Python发行版,以及一个超过1000多个开源包的集合.它是免费和易于安装的, ...

随机推荐

  1. pycharm安装TensorFlow

    一.首先说下我在安装TensorFlow的过程中遇到的坑: 1.python的版本是3.5的版本,因为TensorFlow好像只支持到3.5现在.然后python需要安装64位的安装包,如果安装的是3 ...

  2. 省选前的JOI

    RT,发现找不到题,于是又开了新坑 JOI特色:重思考,代码难度(相比NOI系列)基本没有 (省选前到处挖坑2333) JOI 2017 Final 焚风现象 差分,莫得了 (不是看到200ms就tm ...

  3. JavaScript深入之执行上下文栈

    如果要问到 javascript 代码执行顺序的话,想必写过javascript的开发者都会有个直观的印象,那就是顺序执行,例如: var foo = function(){ console.log( ...

  4. http uri唯一标识

    URI:唯一标识并且信息资源(简单理解为:发邮件的地址,身份证号).uri包括url 比如通过查找一个uri,找到一张图片“https://timgsa.baidu.com/timg?image&am ...

  5. mybatis的0和null

    <if test="type!=null and type!=''">这样判断会把0也当做null的 另外写一个条件判断0 <if test="type ...

  6. 手机nv

    NV值是记录手机的射频参数的,和手机的IMEI号.手机信号.WIFI信号等有关,如果NV值刷没了,手机没有这些校准的数据了,会对手机有一定的影响. qcn里面包含手机的imei 所有改变imei就改变 ...

  7. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:co

    在pom中加入下面代码: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId&g ...

  8. 二叉查找树(BST)、平衡二叉树(AVL树)(只有插入说明)

    二叉查找树(BST).平衡二叉树(AVL树)(只有插入说明) 二叉查找树(BST) 特殊的二叉树,又称为排序二叉树.二叉搜索树.二叉排序树. 二叉查找树实际上是数据域有序的二叉树,即对树上的每个结点, ...

  9. Luogu P4768 [NOI2018]归程

    题目链接 \(Click\) \(Here\) \(Kruskal\)重构树的好题.想到的话就很好写,想不到乱搞的难度反而相当高. 按照点的水位,建出来满足小根队性质的\(Kruskal\)重构树,这 ...

  10. 理解I/O:随机和顺序

    转自:https://blog.csdn.net/BaiWfg2/article/details/52885287 原文:http://www.violin-memory.com/blog/under ...