How to change the default file path in Jupyter?
To modify the default file path of Jupyter, you can follow these steps:
- Open the terminal or command prompt window.
- Enter the following command to open the Jupyter configuration file:
- Create a configuration file for Jupyter Notebook using the command: jupyter notebook –generate-config
- This will create a configuration file named jupyter_notebook_config.py in the user directory.
- Open the jupyter_notebook_config.py configuration file (you can use any text editor to open it), and locate the following line:
- The notebook directory is empty.
- Remove the comment symbol # in front of it and fill in the desired default file path after the equal sign. For example, if you want to set the default file path to /path/to/directory, the modified line should be:
- Set the notebook directory to ‘/path/to/directory’.
- Save and close the configuration file.
- Restart Jupyter Notebook. The default file path will now be set to the path you specified.
Please note that if you specify a file path when running Jupyter Notebook, it will use that path instead of the default path.