Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JUPYTER_PATH in environment variables not working

I am trying to update JUPYTER_PATH for Jupyter notebook. I set the environment variables following the jupyter documentation but still jupyter contrib nbextension install --user, for example, installed under C:\Users\username\AppData\nbextensions instead of C:\somedir\AppData\Roaming\jupyter\nbextensions.

Added these to my environment variables.

JUPYTER_CONFIG_DIR=C:\somedir\.jupyter
JUPYTER_PATH=C:\somedir\AppData\Roaming\jupyter
JUPYTER_RUNTIME_DIR=C:\somedir\AppData\Roaming\jupyter

jupyter --path shows

PS C:\somedir\> jupyter --path
config:
    C:\somedir\.jupyter
    C:\anaconda\python27\win64\431\etc\jupyter
    C:\ProgramData\jupyter
data:
    C:\somedir\AppData\Roaming\jupyter
    C:\Users\username\AppData\Roaming\jupyter
    C:\anaconda\python27\win64\431\share\jupyter
    C:\ProgramData\jupyter
runtime:
    C:\somedir\AppData\Roaming\jupyter

jupyter --data-dir shows

jupyter --data-dir
C:\Users\username\AppData\Roaming\jupyter

I think C:\Users\username\AppData\Roaming\jupyter needs to be removed but nor sure how. Can you please help?

like image 739
E.K. Avatar asked Nov 26 '25 09:11

E.K.


1 Answers

To set the user data directory, you should instead use the JUPYTER_DATA_DIR environment variable, in your case set to C:\somedir\AppData\Roaming\jupyter. You can also unset JUPYTER_PATH (see below for details).

Although it's not terribly obvious from documentation, the nbextension install command takes no notice of the JUPYTER_PATH environment variable, since it doesn't use the jupyter_core.paths.jupyter_path function, but uses jupyter_core.paths.jupyter_data_dir to construct the user-data nbextensions directory directly.

The entry C:\Users\username\AppData\Roaming\jupyter from the data section of the output of jupyter --paths is the user data directory, since JUPYTER_PATH is used in addition to other entries, rather than replacing any. For your purposes, I suggest you unset JUPYTER_PATH, since you can get what you want without it.

like image 153
jcb91 Avatar answered Nov 27 '25 23:11

jcb91



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!