jupyter笔记本起始目录 [英] jupyter notebook starting directory
问题描述
我正在尝试在Jupyter Notebook中设置自定义起始目录。我编辑了jupyter_notebook_config.py。
I'm trying to set a custom starting directory in Jupyter Notebook. I have edited jupyter_notebook_config.py.
从c.NotebookApp.notebook_dir =行删除#,添加参数:
Removed # from line "c.NotebookApp.notebook_dir =", added parameter:
c.NotebookApp.notebook_dir = u'c:\\my\\chosen\\directory'.
但仍然无效,控制台出现错误,jupyter从默认主目录开始。
But still doesn't work, console coming up with error, and jupyter starting in the default home directory.
我正在使用Windows Server 2008.根据手册,它应该有效。
I'm using Windows server 2008. According to the manuals, it should work.
有没有人有关于我的问题的建议?
Does anyone have a suggestion about my problem?
推荐答案
以下步骤对我来说非常适合Windows:
The followings steps work perfectly for me on Windows:
首先找到Jupyter查找配置文件的目录:
First find which directory Jupyter is looking in for your config file:
jupyter --config-dir
如果没有 jupyter_notebook_config.py
文件该目录,输入以下内容生成一个:
If there is no jupyter_notebook_config.py
file in that directory, generate one by typing:
jupyter notebook --generate-config
然后编辑 jupyter_notebook_config.py
文件并添加如下内容:
Then edit the jupyter_notebook_config.py
file and add something like:
## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = 'c:\\users\\rsignell\\documents\\github'
然后从任何目录开始你的jupyter笔记本:
Then start your jupyter notebook from any directory:
jupyter notebook
它将从您指定的目录开始。
and it will start in the directory you specified.
有关详细信息,请参阅: http://jupyter-notebook.readthedocs.io/ en / latest / config.html
For more info see: http://jupyter-notebook.readthedocs.io/en/latest/config.html
这篇关于jupyter笔记本起始目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!