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

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

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


当前回答

我刚刚把我的项目移植到wsl,运行ubuntu 20+。我也需要在Win中使用文件位置,除了notebook_dir(上面有很好的文档),还有浏览器重定向的问题,应该从默认行为中改变。这个答案与笔记本服务器无关。

配置文件的生成在前面的响应中处理;所以我就不在这里描述了。请在

浏览器重定向的默认行为需要停止,因此您应该设置c.NotebookApp。use_redirect_file = False 设置您的首选工作目录;在我的情况下,我使用挂载驱动器,所以c.NotebookApp。notebook_dir ="/mnt/<mount_point>/<目录的全路径,使用/和no: >/"

这使得笔记本可以在首选的Win目录上无缝启动。

其他回答

钻石笔记本和钻石实验室(且说

对于旧的Jupyter Notebook接口,安装在Notebook包中并作为Jupyter Notebook运行(请参阅下一节,以nbclassic安装并以Jupyter nbclassic运行,以及用于JupyterLab):

Open cmd (or Anaconda Prompt) and run jupyter notebook --generate-config. This writes a file to C:\Users\username\.jupyter\jupyter_notebook_config.py. Browse to the file location and open it in an Editor Search for the following line in the file: #c.NotebookApp.notebook_dir = '' Replace by c.NotebookApp.notebook_dir = '/the/path/to/home/folder/' Make sure you use forward slashes in your path and use /home/user/ instead of ~/ for your home directory, backslashes could be used if placed in double quotes even if folder name contains spaces as such : "D:\yourUserName\Any Folder\More Folders\" Remove the # at the beginning of the line to allow the line to execute

朱比特经典笔记本>= 3

最近nbclassic和JupyterLab >= 3使用c.ServerApp。root_dir而不是c.NotebookApp。Notebook_dir(和jupyter server—generate-config而不是jupyter notebook—generate-config)。

有关上下文,请参阅迁移指南和关于服务器和笔记本之间差异的问题。

你可以像这样制作windows bat文件。

D: (your dexired drive)
cd \Your\Desired\Start\Derectory
Jupyter notebook

保存为“JupyterNB.bat”(或任何你喜欢的),并双击它。

如果你的目标是永久性地改变创业地点。您可以通过更改笔记本的快捷方式来实现这一点。假设你用的是Windows 10

按下开始并在Anaconda文件夹中找到Jupter Notebook 右键单击->更多->打开文件位置 右键点击Jupyter笔记本短可爱->属性 现在在目标中:您将在末尾看到类似于“%USERPROFILE%/”的内容。将%USERPROFILE%/的内容替换为所需的目录。如。“D: \ GoogleDrive”

祝你好运

同意大多数答案,除了在jupyter_notebook_config.py中,你必须把

#c.NotebookApp.notebook_dir='c:\\test\\your_root'

双\\是关键答案

Windows 10:

寻找木星笔记本快捷方式(在开始菜单>Anaconda)。 右键单击“属性”。 如截图所示,添加你想要的路径(但使用/ not \ for path):