更改 IPython/Jupyter 笔记本工作目录 [英] Change IPython/Jupyter notebook working directory

查看:41
本文介绍了更改 IPython/Jupyter 笔记本工作目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打开 Jupyter 笔记本(以前称为 IPython)时,它默认为 C:UsersUSERNAME.

When I open a Jupyter notebook (formerly IPython) it defaults to C:UsersUSERNAME.

如何将其更改为其他位置?

How can I change this so to another location?

推荐答案

jupyter notebook --help-all 可能会有所帮助:

--notebook-dir=<Unicode> (NotebookManager.notebook_dir)
    Default: u'/Users/me/ipynbs'
    The directory to use for notebooks.

例如:

jupyter notebook --notebook-dir=/Users/yourname/folder1/folder2/

如果需要,您当然可以在您的配置文件中设置它,您可能需要在 Windows 中转义反斜杠.

You can of course set it in your profiles if needed, you might need to escape backslash in Windows.

请注意,这将覆盖您可能在 jupyter_notebook_config.py 文件中设置的任何路径.(您可以在其中设置一个变量 c.NotebookApp.notebook_dir,它将成为您的默认启动位置.)

Note that this will override whatever path you might have set in a jupyter_notebook_config.py file. (Where you can set a variable c.NotebookApp.notebook_dir that will be your default startup location.)

这篇关于更改 IPython/Jupyter 笔记本工作目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆