Jupyter Notebook : 'Bad config encountered during initialization. No such notebook dir : D:/ABC'

Viewed 5847

I run Windows10, use the latest Anaconda3 (2019) and have installed Jupyter Notebook through conda.

I used to run Jupyter Notebook by navigating to a folder where I save my Jupyter Notebooks named \jupyter_notebook_files and from that directory running the command jupyter notebook from cmd.

A few hours ago I deleted for space saving reasons a folder named ABC.

When now I try to run Jupyter Notebook I get the message:

[C 20:57:04.610 NotebookApp] Bad config encountered during initialization:
[C 20:57:04.611 NotebookApp] No such notebook dir: ''D:/ABC''

I dealed with this problem by typing:

C:\WINDOWS\system32>jupyter notebook --notebook-dir='D:\DIGITAL_LIBRARY\Jupyter_Notebook_Files'

Is there a way to make this folder default and not have to repeat each time the clause: -notebook-dir='D:\DIGITAL_LIBRARY\Jupyter_Notebook_Files' ?

2 Answers

Try to run this code on the terminal:

jupyter --config-dir

The output will be a path. Go to that folder and delete all the contents.

Then run

jupyter notebook

Close Anaconda and or any related programs that are running (Presumably Jupyter is not). Drop down to the command prompt in Windows 10 (or other terminal if you have a different OS). Enter the command:

jupyter --config-dir

This will give you the configuration directory for Jupyter, which will most likely look something like this:

C:\Users<Your Local Account>.jupyter

use CD to go to that directory and use Notepad or your favorite text editor to edit the file called "jupyter_notebook_config.py" - for example:

notepad jupyter_notebook_config.py

Now use find (F3) to search for the line that begins with "c.NotebookApp.notebook_dir = ". The directory that follows the "=" sign probably doesn't exist. So copy that and create the directory OR enter the directory you want instead.

Save and Start Jupyter.

Related