jupyter notebook 起始目录 [英] 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 notebook:
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
这篇关于jupyter notebook 起始目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!