我试着按照Jupyter笔记本文档上的说明去做。

不幸的是,我还没弄明白。这个“开始”的领域到底在哪里?

我有一个windows 7(64位)系统,安装了Anaconda3(不在C驱动器中)。我想改变Jupyter开始文件夹的位置。


当前回答

我刚刚遇到了同样的问题,并测试了上面提到的方法。经过几次尝试,我意识到他们是部分正确的,并不是完整的解决方案。我用python 3.6在Windows 10和Anaconda 4.4.0中测试了以下内容。

有两种方法,尽管它们只有很小的区别。 遵循上述marneylc建议的方法:即。

1)打开“Anaconda Prompt”,输入jupyter notebook—generate-config

2)您可以在C:\Users\username\.jupyter\jupyter_notebook_config.py中找到该文件

3)更改#c.NotebookApp的行。Notebook_dir = " c.NotebookApp。Notebook_dir = 'c:\test\your_root\'

4)打开Jupyter Notebook的快捷方式:c:\用户\用户名\ appdata \漫游\微软\ windows \开始菜单\程序\Anaconda3(64位)

5)右键单击并进入属性

6)在Target字段中,按照上面的stenlytw建议,删除%USERPROFILE%。

7)然后,在Start In的字段中,输入jupyter_notebook_config.py中c:\test\your_root\的相同目录

8)完成了!

作为更简单的方法,在步骤3之后,转到C:\Users\User_name\Anaconda3\Scripts

4-2)可以看到jupyter-notebook.exe文件,单击它。

5-2)然后,Jupyter启动你在jupyter_notebook_config.py中指定的文件夹。制作这个文件的快捷方式。

6 - 2)。

其他回答

[1]  cd e:

通过以下方法进行测试:

[2] pwd

我刚刚遇到了同样的问题,并测试了上面提到的方法。经过几次尝试,我意识到他们是部分正确的,并不是完整的解决方案。我用python 3.6在Windows 10和Anaconda 4.4.0中测试了以下内容。

有两种方法,尽管它们只有很小的区别。 遵循上述marneylc建议的方法:即。

1)打开“Anaconda Prompt”,输入jupyter notebook—generate-config

2)您可以在C:\Users\username\.jupyter\jupyter_notebook_config.py中找到该文件

3)更改#c.NotebookApp的行。Notebook_dir = " c.NotebookApp。Notebook_dir = 'c:\test\your_root\'

4)打开Jupyter Notebook的快捷方式:c:\用户\用户名\ appdata \漫游\微软\ windows \开始菜单\程序\Anaconda3(64位)

5)右键单击并进入属性

6)在Target字段中,按照上面的stenlytw建议,删除%USERPROFILE%。

7)然后,在Start In的字段中,输入jupyter_notebook_config.py中c:\test\your_root\的相同目录

8)完成了!

作为更简单的方法,在步骤3之后,转到C:\Users\User_name\Anaconda3\Scripts

4-2)可以看到jupyter-notebook.exe文件,单击它。

5-2)然后,Jupyter启动你在jupyter_notebook_config.py中指定的文件夹。制作这个文件的快捷方式。

6 - 2)。

从所需位置打开Jupyter Notebook最简单的方法是打开Anaconda Prompt(仅当您使用Anaconda Distribution安装Python时才可能)。

在Windows文件资源管理器中打开所需位置,从Windows文件资源管理器的地址栏复制所需位置。Alt + D到地址栏,Ctrl + C复制位置。

现在打开Anaconda Prompt并输入以下命令:

cd D:\desired location

不知怎么的,蟒蛇提示符回到了原来的位置。输入“d:”,提示符将到达您想要的位置(如下图所示)。请注意,您必须输入所需位置的驱动器号(C:表示C:\ drive-主分区)。

然后,输入“jupyter notebook”,jupyter notebook就会打开。

注意,Jupyter Notebook的主页没有列出任何东西,因为文件夹是空的。

一旦创建了Python3笔记本,主页就会列出这些文件。

这样您就可以从任何位置打开Jupyter Notebook,而不必处理前往安装位置并进行必要调整的所有复杂问题。

我用的是Windows 10,不过是同一个版本的Anaconda。

Click on the Start Menu, then All Programs (just Programs for Win10) Click on the Anaconda3 folder; mine is Anaconda3 (64-bit) In there you should see Jupyter Notebook. If you have a virtual environment installed, it will be followed by the environment name like this: Jupyter Notebook (env) Right-click Jupyter Notebook entry and navigate to More => Open File Location Right-click the correct Jupyter Notebook entry, then click on Properties Enter a path in the Start in: box; if the path has spaces in it, you must enclose it in double quotes Delete "%USERPROFILE%" at the end of the executable path

对于Windows用户,这里有一个片段,让你右键单击文件夹并打开Jupyter实验室。

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")