【问题标题】:How to change the Jupyter start-up folder如何更改 Jupyter 启动文件夹
【发布时间】:2016-05-17 05:49:13
【问题描述】:

我尝试按照Jupyter Notebook documentation 上的说明进行操作。

不幸的是,我无法弄清楚。这个“起点”字段到底在哪里?

我有一个 Windows 7(64 位)系统,安装了 Anaconda3(不在 C 驱动器中)。我想更改 Jupyter 启动文件夹位置。

【问题讨论】:

标签: path anaconda jupyter-notebook jupyter


【解决方案1】:

如果你是使用jupyter lab,想修改configure文件,需要更新的参数是:

c.ServerApp.root_dir = /path/to/directory/you/want

【讨论】:

    【解决方案2】:

    对于 Windows 用户,这里有一个 sn-p,可让您右键单击文件夹并在那里打开 Jupyter Lab。

    def add_jupyter_to_context_menu(self):
        import winreg
    
        key = winreg.HKEY_CURRENT_USER
        command_value = rf'cmd.exe /k jupyter lab --notebook-dir="%V"'
    
        handle = winreg.CreateKeyEx(key, "Software\Classes\directory\Background\shell\Open with JupyterLab\command", 0,
                                    winreg.KEY_SET_VALUE)
        winreg.SetValueEx(handle, "", 0, winreg.REG_SZ, command_value)
    
        # You need to download the icon yourself, or leave this part out for no icon
        icon_value = fr"C:\some_folder\jupyter_icon.ico"
        handle = winreg.CreateKeyEx(key, "Software\Classes\directory\Background\shell\Open with JupyterLab", 0,
                                    winreg.KEY_SET_VALUE)
        winreg.SetValueEx(handle, "icon", 0, winreg.REG_SZ, icon_value)
    
    def remove_jupyter_from_context_menu(self):
        import winreg
        key = winreg.HKEY_CURRENT_USER
        winreg.DeleteKey(key, "Software\Classes\directory\Background\shell\Open with JupyterLab\command")
        winreg.DeleteKey(key, "Software\Classes\directory\Background\shell\Open with JupyterLab")
    
    

    【讨论】:

      【解决方案3】:

      截至 2021 年 12 月的今天,Jupyter 实验室对其配置文件进行了一些更改。因此,如果您遵循 Marneylc 的答案,这也是公认的答案,那么您应该寻找这一行

      # c.ServerApp.root_dir = ''
      

      而不是

      #c.NotebookApp.notebook_dir = ''
      

      在报价单中添加您想要的位置,它会正常工作?

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-03-21
        • 2016-11-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-03-24
        • 1970-01-01
        相关资源
        最近更新 更多