The following describes how to solve the same problem that I encountered. Most of the steps I took to solve the problems are already described in the solutions provided earlier by others.
There are two ways to run the Jupyter Notebook application.
- From Anaconda Navigator
- Use the shortcut (name: Jupyter Notebook) for the Jupyter Notebook application. On Windows, it is usually located in the folder: "C: \ Users \\ AppData \ Roaming \ Microsoft \ Windows \ Start Menu \ Programs \ Anaconda3 (64-bit)"
There are various ways to configure the Jupyter Notebook application to save notebooks in a folder other than the default folder.
When using Anaconda Navigator to start a laptop
If you are using the Anaconda navigator to launch the Jupyter laptop application, the configuration method is to uncomment the c.NotebookApp.notebook_dir field in jupyter_notebook_config.py and add a path. After updating, the field looks like this: c.NotebookApp.notebook_dir = < Enter the absolute path here >
In the case of Windows, and when Anaconda is installed for a specific user, this file is located in C: \ Users \ < USERNAME > .jupyter.
If you did not find the ".jupyter" folder, follow these steps to create it.
- Run the anaconda command line
- At the command prompt, run "jupyter notebook --generate-config"
If you use a shortcut to launch the Jupyter Notebook application (name: Jupyter Notebook)
If you examine the command in the target field of this shortcut, you will notice that the Notebook application starts by executing the file "C: \ Users \ < USERNAME > \ Anaconda3 \ Scripts \ jupyter-notebook-script.py", which takes a path parameter.
The main approach to determining the location where the notebook files will be saved β specify the path to the necessary folder when starting the Jupyter Notebook application. There are two ways to do this:
- Create an environment variable to point to the desired folder and use it as a parameter
- Define the absolute path in the shortcut itself
Follow these steps: (Note: replace the text in angle brackets with the actual text)
- Find the "Notepad Jupyter" label. When Anaconda was installed for a specific user (during the installation, the selected option was only for the user), the shortcut (Name: "Jupyter Notepad", Type: Shortcut) was located in "C: \ Users \ < USERNAME > \ AppData \ Roaming \". Microsoft \ Windows \ Start \ Menu \ Programs \ Anaconda3 (64-bit) "
- Right-click on the shortcut and select "Properties"
- In the "Target" field, find C: \ Users \ <USERNAME> \ Anaconda3 \ Scripts \ jupyter-notebook-script.py% USERPROFILE%
Replace "% USERPROFILE%" with
but. Or: an environment variable created to point to the folder in which you want to store notebook files. The command will look like this: C: \ Users \ <USERNAME> \ Anaconda3 \ Scripts \ jupyter-notebook-script.py% <ENVIRONMENTVARIABLE>%
b. OR: the absolute path to the working folder which the laptop files to be saved in the command will look like this:. C: \ Users \ <USERNAME> \ Anaconda3 \ Scripts \ jupyter-notebook-script.py <F: // folder // subfolder >
Replace the text (path) in the "Start with" field with the following text:
but. Or: an environment variable created to point to the folder in which you want to store notebook files. The text in the "Start with" field will look like this:% < ENVIRONMENTVARIABLE >%
b. OR: the absolute path to the working folder in which you want to store notebook files. The text in the "Start with" field will look like this: < F: // folder // subfolder >
Note 1: If there are spaces in the path, then the entire path must be enclosed in double quotes.
Note 2. The paths in this solution apply to situations where Anaconda 3 (and Jupyter 3) is installed on Windows for a specific user (not for all users).
I personally preferred to define an environment variable, rather than hard-writing the path in the shortcut.