Custom packages
SPACE includes the Python packages required by the platform and allows additional packages to be installed for client-specific scripts and notebooks.
Use custom packages when a Python workflow depends on a library that is not included in the standard SPACE Python environment.
Managing custom packages
Custom packages are managed for the SPACE Python environment rather than installed separately inside each notebook.
Administrators can add packages to the custom Python requirements and apply the updated package configuration to the Python service. Packages can also be upgraded or removed when requirements change.
Once installed, a package is available to Python scripts and Jupyter notebooks running in that SPACE environment.
Package requirements
Custom Python dependencies are maintained in requirements-custom.txt.
Standard pip requirement syntax can be used, including version constraints when a workflow requires a particular package version.
For example:
requests
pandas>=2.0
some-package==1.2.3Pin versions when reproducibility is important, particularly for production automation.
Installing and updating packages
SPACE administrators can manage the custom Python package set as part of the SPACE Python service configuration.
When adding a library, include it in the custom requirements so the dependency remains part of the environment rather than relying on a temporary installation from an individual notebook.
This is preferable to running ad hoc pip install commands in notebooks because the required packages remain explicit and can be reproduced when the Python service is updated or redeployed.
Using packages
After a package is available in the environment, import it normally from a script or notebook:
import requestsSee Python scripts and Jupyter for the two primary execution workflows.
For IBM Planning Analytics development, see TM1py.
