How to change the default file path in Jupyter?

To modify the default file path of Jupyter, you can follow these steps:

  1. Open the terminal or command prompt window.
  2. Enter the following command to open the Jupyter configuration file:
  3. Create a configuration file for Jupyter Notebook using the command: jupyter notebook –generate-config
  4. This will create a configuration file named jupyter_notebook_config.py in the user directory.
  5. Open the jupyter_notebook_config.py configuration file (you can use any text editor to open it), and locate the following line:
  6. The notebook directory is empty.
  7. 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:
  8. Set the notebook directory to ‘/path/to/directory’.
  9. Save and close the configuration file.
  10. 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.

广告
Closing in 10 seconds
bannerAds