-
Notifications
You must be signed in to change notification settings - Fork 4
Every day work with JupyterLab
You'll need some special commands in order to actually use the JupyterLab in Docker.
These commands assume that you:
- Already have Docker running.
- Have at some point previously build and brought up JupyterLab for your environment.
-
Know the
SERVICE_NAME
,CONTAINER_NAME
, andPORT_NUMBER
for your project. - Have opened a shell and
cd
ed to the root directory for this project, which is the directory in which this file resides.
Instructions on stopping and starting JupyterLab can be found here.
-
To view the Docker container logs, at the command line:
docker logs -f CONTAINER_NAME
If you have trouble with this command, double check your container name.
-
You can exit the logs using the key command
control+c
(also sometimes written as^C
).
- In
environment/requirements.txt
, add the package and version. This is a classicrequirements.txt
:packageName==packageVersion
- Install packages and extensions.
- Find the package on cran.r-project.org (eg: https://cran.r-project.org/package=XML)
- Find the appropriate version of the package, either in the "Package source" link or on the "Old sources" archive page.
- In
environments/r-packages.R
add the package name and version on a new line:This checks whether the package is already installed and at the proper version, and installs it if it is missing or at the wrong version.if (! require("XML") || packageVersion("XML") != "3.99.0.3") { install_version("XML", version="3.99.0.3") }
- Install packages and extensions.
HINT: If the most recent version of the package won't install, you can figure out the most recent compatible version by running packages.install("package-name")
in an R notebook in JupyterLab, then running packageVersion("package-name")
. Then, be sure to find that version on cran.r-project.org and add that version of the package to environments/r-packages.R
.
- Find the extension and version that you want.
- Add the extension name and version to
environment/jupyter-extensions.txt
as a new line.- If the extension can be installed successfully via
pip
, use the following syntax:ipympl,0.9.2
- If the extension cannot be installed using
pip
or otherwise must be installed usingjupyter labextension install
, use the following syntax:jupyterlab-spreadsheet,0.4.1,manual
- If the extension can be installed successfully via
- Install packages and extensions.
You need to rebuild the container in order for package changes to take effect.