Navigation
Related:
Themes:
# Install a pip package in the current Jupyter kernel
import sys
!{sys.executable} -m pip install numpy
Of course, it is recommended to manage packages via Anaconda, when on Windows.
In Anaconda Prompt:
jupyter notebook --generate-config
and then searching for, un-commenting and setting the following entries in the created file:
## The directory to use for notebooks and kernels.
# Default: ''
c.NotebookApp.notebook_dir = 'C:/Users/<username>/Dropbox/'
Be aware to use forward slashes in the path, even when on Windows.
Further, it is important to remove the userprofile and homepath, according to:
https://stackoverflow.com/questions/35254852/how-to-change-the-jupyter-start-up-folder
Target: C:\Users\<username>\anaconda3\python.exe C:\Users\<username>\anaconda3\cwp.py C:\Users\<username>\anaconda3 C:\Users\<username>\anaconda3\python.exe C:\Users\<username>\anaconda3\Scripts\jupyter-notebook-script.py "%USERPROFILE%/"
Start in: %HOMEPATH%
When starting Jupyter, it generates the warning message that notebook_dir is moved to server config, but at the time of writing (27/12/2021) changing the setting in this config file did not work. Server config was generated by:
jupyter server --generate-config
Ignoring the message and using the jupyter-config worked. Perhaps in a future Jupyter update the server config is enforced.
In the config file (generated, see above), change the following setting:
## Allow access to hidden files
#c.ContentsManager.allow_hidden = False
c.ContentsManager.allow_hidden = True