Jupyter NoteBook
Jupyter NoteBook 运行配置
什么是 Jupyter NoteBook
1 |
Jupyter Notebook, 以前又称为 |
检测 Python 系统版本并升级
1 |
# 检测 python 版本信息 |
更换pip
镜像
1 |
# 创建 pip 文件夹 |
安装、运行、配置: Jupyter NoteBook
-
安装
1
pip install jupyter
-
运行
1
jupyter notebook
-
运行方式
-
-
配置
Jupyter NoteBook
打开默认目录 1
2
3
4
5# 获取配置文件目录
进入 Windows(cmd->dos)命令行界面,输入: jupyter notebook --generate-config 命令后会返回配置文件路径
# 使用相应记事本打开,修改如下,之后保存关闭
在文件中搜索 notebook_dir-
修改为如下信息
-
-
创建一个文件
-
运行
-
主题配置
-
安装主题
1
pip install jupyterthemes
-
显示主题列表
1
2
3
4
5
6
7
8
9
10
11
12➜ ~ jt -l
Available Themes:
chesterish
grade3
gruvboxd
gruvboxl
monokai
oceans16
onedork
solarizedd # 墨绿
solarizedl # 淡黄
➜ ~ ✗ -
设置
主题
,字体
,字体大小
,宽度 1
2
3
4
5# 设置
jt -t onedork -f fira -fs 12 -cellw 96% -ofs 12 -dfs 12 -T
# 恢复默认主题
jt -r-
效果
-
添加如下样式信息【
C:\Users\coderitl\.jupyter\custom
】-
样式预览
-
样式添加
1
2
3
4
5div.CodeMirror-code{
font-family: "consolamono";
font-size: 12px;
line-height: 36px;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34.CodeMirror pre {
font-family: Consolas;
font-size: 12pt;
}
* {
font-family: Consolas;
}
div.output_area pre {
font-family: Consolas;
font-size: 12pt;
}
div.input_prompt {
font-family: Consolas;
font-size: 12pt;
}
div.out_prompt_overlay {
font-family: Consolas;
font-size: 12pt;
}
div.prompt {
font-family: Consolas;
font-size: 12pt;
}
span.cm-comment {
font-family: Consolas ;
font-style: normal ;
color: #BB3D00 ;
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30* {font-family: Consolas;}
/*Markdown 单元格字体的大小*/
.text_cell_render{
font-size: 12pt;
line-height: 24px;
letter-spacing: 1px;
font-style: normal ;
/* font-family: san francisco, "PingFangSC-Medium" !important; */
}
/*修改的是注释的字体样式与大小还有,字体 */
span.cm-comment {
font-family: san francisco, "PingFangSC-Medium", "Microsoft YaHei" ;
font-size: 12pt;
font-style: normal ;
/*color:#BB3D00 !important;*/
}
/*这里修改的是 Code 里的方字大小 */
pre.CodeMirror-line{
font-family: Consolas, "PingFangSC-Medium", "Microsoft YaHei";
font-size: 20px
}
/* 输出结果 */
div.output pre {
font-family: Consolas, "PingFangSC-Medium", "Microsoft YaHei";
line-height: 20px;
-webkit-font-smoothing: antialiased ;
font-size: 12pt;
}1
jt -t monokai -T -N -fs 13 -f consolamono
-
-
-
配置快捷提示【
在
anaconda 中的 jupyter
扩展不会显示】 1
2python -m pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user --skip-running-check
-
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 coder-itl!
评论