一、安装
jupyter.bat快捷键设置
安装 nbextensions实现代码自动补全。
一、 安装
pip install jupyter
-
检查
jupyter --version
image.png
-
配置密码
jupyter notebook password
-
运行
- cd到你存放以
.ipynb
格式的文件夹
2.jupyter notebook
按照上面的步骤我们每次启动jupyter都要打开CMD切换到目录,运行jupyter notebook命令,每次都要这么做比较麻烦,我们可以写一个.bat
的脚本,解决这个问题
步骤:
- 新建jupyter.txt 文件
2.切换到存放.ipynb
文件的根目录,如 E盘
3.cd 到存文文件的目录
4.jupyter notebook
@echo off
I:
cd I:\joyful-pandas-master
jupyter notebook
![](https://img.haomeiwen.com/i13983750/a316f94935ccc288.png)
5.保存文件,修改文件格式为.bat
以后直接双击.bat文件,就可以直接打开jupyter网页地址
![](https://img.haomeiwen.com/i13983750/9a1a038f098e9d8c.png)
如果存放的目录需要更换,可以更换cd 到的目录即可
双击.bat文件可以看到如下界面
![](https://img.haomeiwen.com/i13983750/c0dcbb9b919c3299.png)
但是问题又来了,python 的包太多了,方法也太多了,参数就更不要说了,这些我们总不能挨个去记忆吧,所以我们希望jupyter 可以像IDE 一样,给我们一些方法的参数提示或者直接给自动补全代码,这样也方便我们使用,接下来按照如下步骤来配置jupyter 的自动代码补全:
1.命令行安装 nbextensions:先后输入如下2个命令
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
2.命令行安装 nbextensions_configurator:
pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user
3.完成上述两步之后,重新启动jupyter, 在弹出的主页面里,能看到增加了一个Nbextensions标签页,在这个页面里,勾选Hinterland即启用了代码自动补全,如下图所示:
![](https://img.haomeiwen.com/i13983750/e0bc1874900ff454.png)
- 来体验一下jupyter 自动补全代码功能的强大吧。
![](https://img.haomeiwen.com/i13983750/0dd3f1bf429fef18.png)
网友评论