- Install
jupyterlabon Ubuntu withoutconda.
# sudo apt update # if needed
# sudo apt install python3-pip python3-dev # if needed
pip3 install jupyterlab-
Generate a Jupyter configuration file and modify.
# Create a configuration file at `~/.jupyter/jupyter_lab_config.py`. jupyter lab --generate-config # Open the configuration file in a text editor. vi ~/.jupyter/jupyter_lab_config.py
-
ex1) Change the port.
# find the line in `~/.jupyter/jupyter_lab_config.py` c.ServerApp.port = 8888 # uncomment and change to desired port
Or, alternatively, set the port temporarily.
jupyter lab --port=8888
-
ex2) Set the password.
from jupyter_server.auth import passwd passwd(algorithm='sha1') # enter desired password to input.
# find the line in `~/.jupyter/jupyter_lab_config.py` c.ServerApp.password = 'sha1:7ddaddc0d166:b2f60bec76c286c2a68b2d703cf2a24db2a5d3f5' # example when password is set to '1234'
Or, alternatively, set the password temporarily.
jupyter lab --NotebookApp.token='1234' # example when password is set to '1234'
-
ex3) Set the root directory.
# find the line in `~/.jupyter/jupyter_lab_config.py` c.ServerApp.root_dir = '/path/to/your/directory' # uncomment and change to desired directory
Or, alternatively, set the root directory temporarily.
jupyter lab --notebook-dir=/path/to/your/directory # or jupyter lab --LabApp.root_dir=/path/to/your/directory
-
-
Use a virtual environment as a jupyter kernel.
-
Register kernel.
-
Activate the virtual environment.
source /path/to/venv/bin/activate -
Install
ipykernelin the virtual environment.pip install ipykernel
-
Add the virtual environment as a kernel.
# Run the code while virtual environment is still active. python -m ipykernel install --user --name name_of_kernel --display-name "Kernel Name"
-
-
Unregister kernel.
-
View the list of all registered jupyter kernels.
jupyter kernelspec list
-
Remove the virtual environment from jupyter.
jupyter kernelspec uninstall name_of_kernel
-
-