Installing Python packages on Db2 Warehouse
Application code that is written in Python often uses functions that are provided by Python packages. The installed packages are automatically available on each Db2 Warehouse node in a cluster.
While Python packages, such as numpy, can be provided also as Python egg files, it is more convenient to manage Python packages by using a package manager such as pip.
If the Python version that is used by Db2 Warehouse or Integrated Analytics System changes, previously installed packages cannot be accessed anymore. The change log indicates such changes and provides upgrade instructions.
- For Db2 Warehouse: What's New in IBM Db2 Warehouse
- For Integrated Analytics System: Release notes
On Db2 Warehouse:
To install a Python package on Db2 Warehouse and make it available for all users, do the following steps:
- Connect to the Db2 Warehouse node with an SSH client.
- On the Docker host node, from outside your Db2 Warehouse
container, issue the following command:
docker exec -it Db2wh /bin/bash
- Install the Python package for all users by issuing the following
commands:
su - bluadmin spark-pip install --root /mnt/blumeta0/site-python package name
On Integrated Analytics System
To install a Python package on Integrated Analytics System, do one of the following steps depending on whether you want to install the package for a single user or for all users:
- To install a Python package for a single user on Integrated Analytics System, do the following steps:
- Connect to the Integrated Analytics System node as an arbitrary user by
issuing the following command:
Where user is the name of the single user, and host is the name of the docker host.ssh user@host -p 50022
- Install the Python package for a single user by issuing the following
command:
spark-pip install --user package name
- Connect to the Integrated Analytics System node as an arbitrary user by
issuing the following command:
- To install a Python package for all users on Integrated Analytics System,
do the following steps:
- Connect to the Integrated Analytics System node as the bluadmin user by
issuing the following
command:
Where host is the name of the docker host.ssh bluadmin@host -p 50022
- Install the Python package for all users by issuing the following
command:
spark-pip install --root /mnt/blumeta0/site-python package name
Based on the system setup of Integrated Analytics System for Python, these packages are automatically available for every user.
- Connect to the Integrated Analytics System node as the bluadmin user by
issuing the following
command: