Customizing environment templates with pip

Depending on your system settings, you can configure your custom environment template to use the public PyPI repository, custom packages from a shared storage volume or from project storage.

Required roles

  • You need Admin or Editor permissions on the project to create an environment template and add a software configuration.

Installing pip packages from the public PyPI repository

To install pip packages from the public PyPI repository:

  1. In the UI, open your custom environment template, find the Create link and then click it. A text area that contains an example customization appears. This area is equivalent to a requirements.txt file.
  2. Add your customizations and then click Apply.

Example input:

pandas==1.5.0
numpy==1.23.0
scikit-learn==1.1.0

This entry is equivalent to running !pip install pandas==1.5.0 numpy==1.23.0 scikit-learn==1.1.0 in a notebook.

Installing pip packages from a shared storage volume

Your platform administrator can add a custom Python distribution package to a directory on a shared storage volume. You then add the path to the package in your custom environment template where it will be picked up by the runtime builds.

Installing pip packages from project storage

You can add a custom Python distribution package to your project in Watson Studio and then add the path to this file to your environment template where it will be picked up by the runtime builds.

To add pip packages from project storage to your custom environment template:

  1. Create a Python project with a setup.py build script.
  2. Generate a distribution package.
  3. Upload the zipped distribution file to your project as a data asset.
  4. Create an environment template in your project and add a customization.

Refer to Examples of environment template customizations

Learn more