安装jupyter notebook的主题,修改jupyter的默认路径;安装jupyterthemes后,提示jt 不是内部或外部命令

xiaoxiao2021-03-01  37

按照这篇博客https://blog.csdn.net/Jinlong_Xu/article/details/79221943,安装好jupyterthemes后,我想用jt-l这个命令,却提示我jt 不是内部或外部命令 安装命令是:pip install jupyterthemes 如果你用pip install jupyter-themes这个加了横杠,会提示我找不到相应版本,不知道为啥 用list available themes 也是如此提示: 原因: 我装jupyter themes 装到了C:\Users\dlh\AppData\Roaming\Python\Python36\site-packages 这个路径并不在我的环境变量中 每个人的可能不太一样, 自己从命令行中找一下,如果装的路径本来就是在环境变量中,那就可以运行jt -l这个命令 如果不是,就把C:\Users\dlh\AppData\Roaming\Python\Python36\Scripts加到你的环境变量中吧

选择主题

jt -l

选择安装某个主题

jt -t chesterish -T -N

jupyter notebook就变成这样啦 推荐一个挺好的主题,大家可以试试,还修改了cellw(占屏比或宽度) -ofs(输出段的字号) -T(显示工具栏)

jt -t oceans16 -f fira -fs 13 -cellw 90% -ofs 11 -dfs 11 -T

修改jupyter的默认路径:(参考https://blog.csdn.net/u014552678/article/details/62046638) 打开Windows的cmd,在cmd中输入

jupyter notebook --generate-config

打开此文件找到

The directory to use for notebooks and kernels.

## The directory to use for notebooks and kernels. #c.NotebookApp.notebook_dir = ''

改成自己的路径 再重新打开就行啦

如果是Ubuntu 系统的话,则在配置文件中找到:

#c.NotebookApp.default_url = '/tree'

将其改为:

c.NotebookApp.default_url = '/tree/Coding'

此时,Jupyter notebook的默认目录路径就变成了/home/Coding (参考:https://blog.csdn.net/kaien1226/article/details/81480368)

转载请注明原文地址: https://www.6miu.com/read-4050038.html

最新回复(0)