How to Change Jupyter Notebook Default Folder
If you are a data scientist or software engineer who uses Jupyter Notebook as your primary tool for data analysis, you might have noticed that the default folder for your notebooks is not always the most convenient location for your work. In this article, we will explain how to change the default folder for your Jupyter Notebook, so you can save your work in a more accessible location.
Table of Contents
Introduction 1.1 What is Jupyter Notebook? 1.2 Why Change Jupyter Notebook Default Folder?
Changing Jupyter Notebook Default Folder 2.1 Steps to Modify Jupyter Configuration
What is Jupyter Notebook?
Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations, and narrative text. It supports multiple programming languages, including Python, R, Julia, and more. Jupyter Notebook is widely used in data analysis, scientific research, and education.
Why Change Jupyter Notebook Default Folder?
By default, Jupyter Notebook creates a folder called “notebooks” in your home directory and saves your notebooks in this folder. However, this default folder may not be the most convenient location for your work. For example, if you work with multiple projects, you may want to save your notebooks in project-specific folders. Changing the default folder can also help you organize your work better and improve your workflow.
How to Change Jupyter Notebook Default Folder
To change the default folder for your Jupyter Notebook, you need to modify the Jupyter configuration file. Here are the steps:
Open the terminal or command prompt on your computer.
Type
jupyter notebook --generate-config
and press Enter. This will generate a configuration file for Jupyter Notebook.Type
jupyter --config-dir
and press Enter. This will show you the directory where the configuration file is stored.Navigate to the configuration directory using your file explorer.
Open the
jupyter_notebook_config.py
file in a text editor.Look for the following line of code:
## The directory to use for notebooks and kernels. #c.NotebookApp.notebook_dir = ''
Uncomment the second line by removing the “#” symbol at the beginning of the line.
Replace the empty string with the path to the folder where you want to save your notebooks. For example, if you want to save your notebooks in a folder called “my_notebooks” in your home directory, the line should look like this:
c.NotebookApp.notebook_dir = '/home/your_user_name/my_notebooks'
Save and close the file.
Restart your Jupyter Notebook server.
After completing these steps, Jupyter Notebook will use the new default folder specified in the configuration file. You can verify the new default folder by creating a new notebook and checking the directory path displayed in the Jupyter Notebook interface.
Conclusion
Changing the default folder for your Jupyter Notebook can help you organize your work better and improve your workflow. By following the steps outlined in this article, you can change the default folder to a more convenient location. We hope that this article has been helpful in solving the issue of Jupyter Notebook default folder won’t change.
About Saturn Cloud
Saturn Cloud is your all-in-one solution for data science & ML development, deployment, and data pipelines in the cloud. Spin up a notebook with 4TB of RAM, add a GPU, connect to a distributed cluster of workers, and more. Request a demo today to learn more.
Saturn Cloud provides customizable, ready-to-use cloud environments for collaborative data teams.
Try Saturn Cloud and join thousands of users moving to the cloud without
having to switch tools.