Installing Python libraries🔗
The Python Script component lets you import modules from any Python library. To do this, you need to upload the packages to an Amazon S3 bucket or Azure Blob Storage location accessible to the Maia Foundation runner, as described below.
Install the Python package🔗
When installing Python libraries for Hybrid SaaS Maia Foundation runners, make sure the libraries are compiled for the correct platform. Hybrid SaaS Maia Foundation runners run on Linux (Ubuntu).
If you install packages on a different operating system (for example, macOS or Windows), pip may fetch incompatible binaries that cannot run inside the Maia Foundation runner. This often causes runtime errors.
Note
Python scripts in Maia should be written to be version-agnostic where possible. The Python runtime bundled with the Maia Foundation runner is updated periodically, and there is no guarantee a specific version will remain in place indefinitely. Be aware of this when installing libraries, and try to ensure the libraries you install are compatible with a range of Python versions where possible.
At time of writing (April 2026), the agent uses Python 3.12.
-
Create a directory on your local machine to store the downloaded libraries:
mkdir python_libs -
Download the required libraries using
pipwith the--platformand--only-binary flags:python3 -m pip install --target=./python_libs --platform=manylinux2014_x86_64 --only-binary=:all: scipy pandas numpyCommand Breakdown :
--target=./python_libs: Specifies the installation directory.--platform=manylinux2014_x86_64: This flag is critical. It directspipto download the package for the specified Linux platform and architecture, matching the agent's environment.--only-binary=:all:: Ensures thatpipdownloads pre-compiled binary wheels instead of attempting to build from source.
-
After the command completes, the
./python_libsfolder will contain the specified libraries and all their dependencies, compiled for the correct platform. -
Copy the entire folder into an S3 bucket (for AWS-hosted Maia Foundation runners) or Azure Blob Storage container (for Azure-hosted Maia Foundation runners) that is accessible to the Maia Foundation runner.
Note
At this point, you can delete the package from your local drive, if you wish.
-
The IAM role tied to the Maia Foundation runner (AWS) or the managed identity (Azure) must have certain user permissions to access this storage location. Read Storing external files for details of these permissions.
- Set a Maia Foundation runner parameter
EXTENSION_LIBRARY_LOCATION, with the value being the absolute path of the cloud storage folder containing the package and its dependencies, for example AWS (S3):s3://my-additional-librariesand Azure Blob Storage:https://mystorageaccount.blob.core.windows.net/my-files. Read Optional Maia Foundation runner parameters for details.
Upon completion, the Python Script component can reference and access your installed libraries via your script.