我正在尝试在 Jupyter Notebook 中设置自定义起始目录。我编辑了 jupyter_notebook_config.py。
从“c.NotebookApp.notebook_dir =”行中删除#,添加参数:
c.NotebookApp.notebook_dir = u'c:\\my\\chosen\\directory'.
但仍然无法正常工作,控制台出现错误,并且 jupyter 在默认主目录中启动。
我使用的是 Windows Server 2008。根据手册,它应该可以工作。
有人对我的问题有什么建议吗?
最佳答案
以下步骤非常适合我在 Windows 上使用:
首先找到 Jupyter 在哪个目录中查找您的配置文件:
jupyter --config-dir
如果该目录中没有 jupyter_notebook_config.py
文件,请键入以下内容生成一个:
jupyter notebook --generate-config
然后编辑 jupyter_notebook_config.py
文件并添加如下内容:
## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = 'c:\\users\\rsignell\\documents\\github'
然后从任何目录启动你的 jupyter 笔记本:
jupyter notebook
它将在您指定的目录中启动。
有关详细信息,请参阅:http://jupyter-notebook.readthedocs.io/en/latest/config.html
关于python - jupyter notebook 起始目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39252884/