Jupyter安装及配置

2019-04-16  本文已影响0人  512song

使用pip进行安装

pip install jupyter

安装运行后无法通过远程访问,需要通过ipython生成秘钥

$ ipython

from notebook.auth import passwd

passwd()

根据提示设置密码,然后记录生成的Sha1秘钥,然后生成Jupyter的配置文件

$ jupyter notebook --generate-config

配置文件在当前用户目录下~/.jupyter/jupyter_notebook_config.py

对配置文件进行修改,加入以下内容:

c.NotebookApp.ip='服务器地址'

c.NotebookApp.password = u'sha1秘钥'

c.NotebookApp.open_browser = False

c.NotebookApp.port =端口号,默认为8888

重启Jupiter,可以通过远程的机器访问,然后安装扩展插件实现代码的自动补全功能

pip install jupyter_contrib_nbextensions

jupyter contrib nbextension install --user --skip-running-check

再次登录Jupiter notebook,可以看到增加了Nbextensions选项,点击后将里面 “Table of Contents” 以及 “Hinterland”勾选,就可以实现代码的自动补全功能。

上一篇 下一篇

猜你喜欢

热点阅读