Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

python - jupyter notebook starting directory

I'm trying to set a custom starting directory in Jupyter Notebook. I have edited jupyter_notebook_config.py.

Removed # from line "c.NotebookApp.notebook_dir =", added parameter:

c.NotebookApp.notebook_dir = u'c:\my\chosen\directory'.

But still doesn't work, console coming up with error, and jupyter starting in the default home directory.

I'm using Windows server 2008. According to the manuals, it should work.

Does anyone have a suggestion about my problem?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The followings steps work perfectly for me on Windows:

First find which directory Jupyter is looking in for your config file:

jupyter --config-dir

If there is no jupyter_notebook_config.py file in that directory, generate one by typing:

jupyter notebook --generate-config

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'

Then start your jupyter notebook from any directory:

jupyter notebook

and it will start in the directory you specified.

For more info see: http://jupyter-notebook.readthedocs.io/en/latest/config.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...