MaxCompute provides built-in images with pre-installed Python packages for data analytics, scientific computing, and machine learning—including NumPy, pandas, scikit-learn, and XGBoost. Reference these images directly in your jobs instead of managing dependencies manually.
Available images
All built-in images include the base packages from the common image: NumPy, pandas, cloudpickle 2.2.1, pickle 5.0.12, requests 2.31.0, and setuptools 68.0.0.
| Image name | Category | Core library | Python version | Use for |
|---|---|---|---|---|
common | Base | NumPy 1.21.6, pandas 1.3.5 | Python 3.7 | General data processing |
common | Base | NumPy 1.26.4, pandas 2.2.2 | Python 3.11 | General data processing |
ubuntu | Base OS | Ubuntu 20.04 | Python 3.7, Python 3.11 | UDF development and MaxFrame integration to improve cross-platform portability and execution performance |
scipy | Scientific computing | SciPy 1.7.3 | Python 3.7 | Statistical analysis and linear algebra |
scipy | Scientific computing | SciPy 1.13.0 | Python 3.11 | Statistical analysis and linear algebra |
statsmodels | Statistical modeling | statsmodels 0.13.5 | Python 3.7 | Statistical modeling and econometrics |
statsmodels | Statistical modeling | statsmodels 0.14.1 | Python 3.11 | Statistical modeling and econometrics |
sklearn | Machine learning | scikit-learn 1.0.2 | Python 3.7 | Classification, regression, and clustering |
sklearn | Machine learning | scikit-learn 1.4.2 | Python 3.11 | Classification, regression, and clustering |
xgboost | Machine learning | XGBoost 1.6.2 | Python 3.7 | Distributed gradient boosting |
xgboost | Machine learning | XGBoost 2.0.3 | Python 3.11 | Distributed gradient boosting |
pytorch | Machine learning | PyTorch 1.13.1 | Python 3.7 | Natural language processing (NLP) |
pytorch | Machine learning | PyTorch 2.3.0 | Python 3.11 | Natural language processing (NLP) |
tensorflow | Machine learning | TensorFlow 2.11.0 | Python 3.7 | Programming various machine learning algorithms |
tensorflow | Machine learning | TensorFlow 2.16.1 | Python 3.11 | Programming various machine learning algorithms |
Python version flags: Use cp37 for Python 3.7 and cp311 for Python 3.11 when setting session flags.
Use built-in images
Built-in images work in MaxCompute SQL user-defined function (UDF), PyODPS, and MaxFrame development.
Specify only one image per job to prevent dependency conflicts.
In SQL UDF jobs
Set the image and Python version at the SQL session level before calling the UDF:
-- For Python 3.11, replace cp37 with cp311
set odps.sql.python.version=cp37;
set odps.session.image = <image_name>;Replace <image_name> with the image name from the table above (for example, sklearn).
In PyODPS
Upgrade PyODPS to V0.11.5 or later before using images.
Pass the image name to the image parameter of the execute or persist method:
image='<image_name>'For a complete example, see Use images in PyODPS development.
In MaxFrame
Set the image in config.options.sql.settings before submitting the job:
config.options.sql.settings = {
"odps.session.image": "<image_name>"
}View built-in images in the console
Log on to the MaxCompute console and select a region in the upper-left corner.MaxCompute console
In the navigation pane on the left, choose Manage Configurations > Images.
On the Images page, click the Built-in Images tab. The tab lists all available built-in images and their version information.