Datalore 2024.4 Help

Customize notebook environment

When in the editor, you can install and manage packages for the notebook you are currently working on. Below is the list of your options.

Environment tool

Recommended as the best option, this tool not only installs packages, but also allows you to manage packages that you installed by editing the environment.yml. Packages that you can manage in the Environment tool are persistent. Find more details in this topic.

Other options

Run commands in the notebook or in Terminal

Packages that you install in this way are NOT persistent.

Edit the environment.yml file

Every notebook is created with an automatically generated environment.yml file, which records the selected environment configuration and all changes to it made via the Environment tool. You can save this file to copy a specific environment configuration and use it in other notebooks.

  1. Open the Attached data tool from the left-hand sidebar of the editor.

  2. Download the environment.yml file.

  3. Add the downloaded file to the attachments of the notebook where you want to use the saved environment configuration.

  4. Refresh the attachment file list to make sure the newly added file replaced the old one.

  5. Restart the computation to have the packages from the new environment.yml file installed.

Packages added from the environment.yml file are persistent and can be viewed and managed in the Environment tool.

requirements.txt file

You can use requirements.txt files to customize the environments of your notebooks. The procedure below includes optional steps for cases when you create such a file in Datalore.

  1. Run pip freeze > requirements.txt.

  2. Open the Attached data tool and download the requirements.txt file.

  3. Add the downloaded file to another notebook's attached files.

  4. Run pip install -r requirements.txt.

Packages added from requirements.txt are not persistent and not recorded into environment.yml.

Last modified: 21 November 2024