Issue
I have a python project with jupyter notebooks and would like to save them in their own sub directory (e.g. jupyter_notebooks
). Now I want to start jupyter, so that the notebooks will use the project root as cwd and not the directory they are in. Something like this:
python -m jupyter --cwd=project\root
Is there a way to do this?
Solution
I think you're looking for the --notebook-dir
argument:
python -m jupyter notebook --notebook-dir=/path/to/directory
Or simply just:
jupyter notebook --notebook-dir=/path/to/directory
You can see all options for the command by running jupyter notebook --help
.
If you want the notebook server to always use a specific directory without supplying the argument, you can generate a configuration file for the notebook server by running:
jupyter notebook --generate-config
The name of the created file will be printed to the console. Then, in this file, uncomment and edit the line where you find the variable c.NotebookApp.notebook_dir
, e.g.:
c.NotebookApp.notebook_dir = '/path/to/directory'
Answered By - hexahedronest
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.