Jupyter Notebook安装配置

安装软件工具及环境

系统环境为:win10
linux中多数命令也是可以用的。

安装Anaconda即可,内含Jupyter notebook
若无jupyter notebook,自行安装即可。

配置环境变量win10
添加到path中
D:\tools\Anaconda3
D:\tools\Anaconda3\Library\bin
D:\tools\Anaconda3\Scripts

配置Jupyter Notebook

生成jupyter notebook配置文件

>>>jupyter notebook --generate-config

生成后会显示生成路径
Jupyter Notebook安装配置

设置密码

>>>jupyter notebook password

如果使用远程连接

from notebook.auth import passwd
passwd()
# 将生成的密令加入下方的配置文件中
c.NotebookApp.password = u'sha1:1d532d3ea68d:f755a8adfe170ef0a5db2908333d35937ef4ec5c'

Jupyter Notebook安装配置

编辑配置文件

c = get_config()
c.IPKernelApp.pylab = "inline"
c.NotebookApp.ip = "*"
# c.NotebookApp.password = u'sha1:1d532d3ea68d:f755a8adfe170ef0a5db2908333d35937ef4ec5c'
c.NotebookAPp.open_browser = False
c.NotebookApp.port= 8888
# 文件存储,jupyter界面路径
c.NotebookApp.notebook_dir = "D:\\tools\\jupyter_code"

安装nb_conda

>conda install nb_cocnda

启动jupyter notebook

>jupyter notetbook

出现问题:
Jupyter Notebook安装配置

'''
anaconda 版本4.4 以后会出现 
修改路径下部分代码
~\Anaconda3\Lib\site-packages\nb_conda\envmanager.py
'''

搜索

        return {
            "environments": [root_env] + [get_info(env)
                                          for env in info['envs']]
        }

改成

        return {
            "environments": [root_env] + [get_info(env) for env in info['envs']
                                          if env != root_env['dir']]
        }

extensions 扩展插件的安装

>conda install -c conda-forge jupyter_contrib_nbextensions