Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autosave directory #5809

Closed
jaghachi opened this issue Dec 27, 2018 · 8 comments
Closed

autosave directory #5809

jaghachi opened this issue Dec 27, 2018 · 8 comments
Labels
question status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@jaghachi
Copy link

jaghachi commented Dec 27, 2018

This has been quite a pain because I have ".ipynb_checkpoints" in every single directory of my project.
I have not been able to find a way to simply change or give it one directory to always save in.

This is causing issues when I'm dynamically loading files and that folder gets pulled in because its sitting just about everywhere.

Please add this next to the autosave interval or someone help me gain my sanity back by quickly showing me where I can code in this setting.

EDIT:
The current working directory for autosave changes to where ever the user last clicks a directory. Could there be an override setting for this to have custom or at least a permanent directory?

Thanks!

@ian-r-rose ian-r-rose added this to the Reference milestone Jan 7, 2019
@ian-r-rose
Copy link
Member

Hi @SleepSux, sorry for the slow reply. You should be able to customize the checkpoints directory by setting the FileCheckpoints.checkpoints_dir configurable in your jupyter_notebook_config.py, or when you launch JupyterLab with

jupyter lab --FileCheckpoints.checkpoint_dir=mydirectory

Closing as answered, but feel free to comment here if you have further questions!

@jaghachi
Copy link
Author

jaghachi commented Feb 16, 2019

Thank you for your response @ian-r-rose. No worries.

I finally tried this, but I receive a "NameError: name 'FileCheckpoints' is not defined" when jupyter notebook loads.

here is the full error.

[E 11:42:51.575 NotebookApp] Exception while loading config file /home/computer/.jupyter/jupyter_notebook_config.py
Traceback (most recent call last):
File "/home/computer/anaconda3/lib/python3.7/site-packages/traitlets/config/application.py", line 562, in _load_config_files
config = loader.load_config()
File "/home/computer/anaconda3/lib/python3.7/site-packages/traitlets/config/loader.py", line 457, in load_config
self._read_file_as_dict()
File "/home/computer/anaconda3/lib/python3.7/site-packages/traitlets/config/loader.py", line 489, in _read_file_as_dict
py3compat.execfile(conf_filename, namespace)
File "/home/computer/anaconda3/lib/python3.7/site-packages/ipython_genutils/py3compat.py", line 198, in execfile
exec(compiler(f.read(), fname, 'exec'), glob, loc)
File "/home/computer/.jupyter/jupyter_notebook_config.py", line 752, in
FileCheckpoints.checkpoints_dir = '/home/computer/Documents/myProjects/notebookCheckpoints'
NameError: name 'FileCheckpoints' is not defined

@ian-r-rose
Copy link
Member

@SleepSux If you are adding it in your jupyter_notebook_config.py, you will need to dot into the config object, so I think you will want something like
c.FileCheckpoints.checkpoint_dir='/home/computer/Documents/myProjects/notebookCheckpoints'

@gsemet
Copy link

gsemet commented May 27, 2019

Indeed, these files are annoying and freezing the checkpoints_dir is not a satisfying solution, since it only use the filename and not the path. So if you have 2 opened "mynotebook.ipynb" file from 2 different folders they will both write in the same file.
Why not hardcoding the path in base64 (or any other hash) and use it to avoid file collision? Why not reconstructing the same path inside checkpoint_dir?

@jasongrout
Copy link
Contributor

This is an issue with the Jupyter notebook server, not with JupyterLab (the code in question lives in https://github.com/jupyter/notebook/, not here). I think the best way forward is opening an issue in the notebook repo and carrying on the conversation there, if you would like to pursue this.

@gsemet
Copy link

gsemet commented May 27, 2019

Opened in jupyter/notebook#4645 :)

@jasongrout
Copy link
Contributor

Thanks!

@lock
Copy link

lock bot commented Aug 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related discussion.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 6, 2019
@jasongrout jasongrout added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

4 participants