jupyter notebook 更改工作环境和浏览器

    Jupyter Notebook(此前被称为 IPython notebook)是一个交互笔记本,支持运行40多种编程语言。本质是一个 web 应用程序,便于创建和共享文学化程序文档,支持实时代码、数学方程、可视化和markdown。          ----百度百科


    (详细信息见官网:http://jupyter.org/)


    这里主要介绍使用过程中遇到的两个问题以及解决方案:


    一、修改 jupyter notebook 默认工作目录:

        方案一:1、(win+r)打开 cmd 输入命令:jupyter notebook --generate-config

                       2、找到文件 jupyter_notebook_config.py (C:\Users\Administrator\.jupyter 中)

                       3、打开该文件 找到  #c.NotebookApp.notebook_dir = ''  并添加(将其修改为):c.NotebookApp.notebook_dir = u'D:\\python' (注意将#号删除,注意是\\双斜线,注意事项,不支持中文,可以有空格)



       方案二:1、进入工作目录(如:“D:\python”)

                      2、按着 shift 键 点击鼠标右键 选择 “在此处打开Powershell窗口(S)”

                      3、进入Powershell窗口输入 “jupyter notebook”




    二、修改 jupyter notebook 默认浏览器:

          方案:1、打开文件 jupyter_notebook_config.py (C:\Users\Administrator\.jupyter 中)

                     2、找到 # c.NotebookApp.browser = ''''

                     3、添加:

                                   import webbrowser

                                   webbrowser.register("chrome", None, webbrowser.GenericBrowser(u"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"))

                                   c.NotebookApp.browser = 'chrome'





你可能感兴趣的:(Python)