0
点赞
收藏
分享

微信扫一扫

JupyterNotebook随记(part2)--更改JupyterNotebook主题

学习笔记,仅供参考,有错必纠

  • 安装第三方库
pip install --user jupyterthemes
  • 查看主题列表

在cmd中键入如下代码:

jt -l

结果返回如下提示:

'jt' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

原因(​​参考文献​​​):
我将jupyterthemes装到了​​​C:\Users\apple\AppData\Roaming\Python\Python36\site-packages​​​,而我没有将​​C:\Users\apple\AppData\Roaming\Python\Python36\Scripts​​加到环境变量中,故我将该路径加入环境变量。

重新打开cmd,敲入如下代码:

jt -l

有如下输出结果:

Available Themes:
chesterish
grade3
gruvboxd
gruvboxl
monokai
oceans16
onedork
solarizedd
solarizedl



  • 选择主题
jt -t chesterish

使工具栏、名称和Logo可见:

jt -t chesterish -T -N -kl



常用可选参数:
JupyterNotebook随记(part2)--更改JupyterNotebook主题_参考文献

注意:可以使用​​jt -h​​​打印出命令​​jt​​​的用法和所有可选参数;​​jt -r​​可以恢复默认主题。



在cmd中键入​​jupyter notebook​​​,随意打开一个.pynb文件,发现报出500错误:
JupyterNotebook随记(part2)--更改JupyterNotebook主题_500错误_02

就算换回原来的主题也会报500错误。

查了一下,解决方法如下(​​参考文献​​):

我直接安装nbconvert,虽然没有500错误了,但是代码跑不动:
JupyterNotebook随记(part2)--更改JupyterNotebook主题_500错误_03



好吧,我不用了,卸载jupyterthemes试试:

pip uninstall jupyterthemes

返回:

Found existing installation: jupyterthemes 0.20.0
Uninstalling jupyterthemes-0.20.0:
Would remove:
c:\users\apple\appdata\roaming\python\python36\scripts\jt.exe
c:\users\apple\appdata\roaming\python\python36\scripts\jupyter-theme.exe
c:\users\apple\appdata\roaming\python\python36\site-packages\.ds_store
c:\users\apple\appdata\roaming\python\python36\site-packages\jupyterthemes-0.20.0.dist-info\*
c:\users\apple\appdata\roaming\python\python36\site-packages\jupyterthemes\*
Proceed (y/n)? y
Successfully uninstalled jupyterthemes-0.20.0

再次打开jupyter notebook:

JupyterNotebook随记(part2)--更改JupyterNotebook主题_参考文献_04

还是跑不动,好家伙,重装jupyter!

pip install --upgrade --force-reinstall --no-cache-dir jupyter

报错,​​解决办法​​​,在anaconda的安装目录下删除他:
JupyterNotebook随记(part2)--更改JupyterNotebook主题_参考文献_05

再次运行:

pip install --upgrade --force-reinstall --no-cache-dir jupyter

报错,​​解决办法​​,敲入:

pip install --ignore-installed pywin32

…连续出现3次错误后,我佛了。

按照​​参考文献​​完全卸载jupyter notebook,再重装:

pip install jupyter
python -m ipykernel install --user
pip install --upgrade --user nbconvert

还是不行…MD…

最后把anaconda卸载了,又重装,打开jupyter notebook,主题的确可以用了,也可以跑代码了,但现在想一下,真是后悔!

JupyterNotebook随记(part2)--更改JupyterNotebook主题_500错误_06

举报

相关推荐

0 条评论