Jupyter Notebook Default Directory Not Updating

  1. Environment Setup:
  • Jupyter Notebook is installed under a virtual environment ana-env.
  • By default, Jupyter Notebook starts in: C:\Users<username>.
  1. Steps Taken to Change Startup Directory:
  • I located the config file: C:\Users<username>.jupyter\jupyter_notebook_config.py
  • I updated the configuration to set the default directory: c.ServerApp.root_dir = β€˜d:\’
  • Saved the changes and restarted Jupyter Notebook.
  1. Observed Behavior:
  • Despite modifying the config file, Jupyter Notebook still starts in the default directory: C:\Users<username>
  • The output message confirms this:

[I ServerApp] Serving notebooks from local directory: C:\Users<username>

  1. Command-Line Launch:
  • When I run the following command: jupyter notebook --notebook-dir=β€œd:\”

The notebook successfully starts in D:.

  1. Warnings in Output:
  • I also noticed warnings during startup:

[W ServerApp] A _jupyter_server_extension_points function was not found…

  1. Other skipped server messages appear:

Questions:

  1. Why is the c.ServerApp.root_dir setting in the config file not taking effect?
  2. Are the startup warnings and skipped server messages related to this behavior?
  3. What steps can I take to ensure Jupyter Notebook uses the updated startup directory from the config file?

jupyter_notebook_config.py for modern installations should be jupyter_server_config.py see Migrating from Notebook Server β€” Jupyter Server documentation

1 Like