This topic describes the runtime environment for writing functions in Function Compute in Python.

Python Rutime

Function Compute currently supports the following Python run time environments.

Version Operating system Architecture
Python 3.9(Python 3.9) Linux x86_64
Python 3(Python 3.6) Linux x86_64
Notice Function Compute has stopped supporting the Python 2.7 runtime environment.
  • As of June 30, 2022, you can create and update functions whose running environment is Python 2.7. However, Function Compute will not provide any feature updates run time by Python 2.7, including security patches.
  • Starting from July 1, 2022, you will not be able to create functions whose runtime environment is Python 2.7. However, you can update existing functions whose runtime environment is Python 2.7.
  • Starting October 1, 2022, you will not be able to update functions whose existing runtime environments are Python 2.7. However, you can still run functions whose existing runtime environments are Python 2.7.

Use built-in Python modules

In addition to the standard Python modules, the Function Compute Python runtime environment also contains some common modules. You can directly reference common modules. The modules currently included are as follows:

Python 3.9(Python 3.9)

Module Description Module Version
oss2 OSS SDK 2.15.0
tablestore Tablestore SDK 5.2.1
aliyun-fc2 FC SDK 2.5.0
aliyun-python-sdk-ecs ECS SDK 4.24.11
aliyun-python-sdk-vpc VPC SDK 3.0.15
aliyun-python-sdk-rds RDS SDK 2.6.1
aliyun-python-sdk-kms KMS SDK 2.15.0
pydatahub DataHub SDK Not supported
aliyun-mns MNS SDK 1.1.5
aliyun-python-sdk-cdn CDN SDK 3.6.7
aliyun-python-sdk-ram RAM SDK 3.2.0
aliyun-python-sdk-sts STS SDK 3.1.0
aliyun-python-sdk-iot IoT SDK 8.30.0
aliyun-log-python-sdk SLS SDK 0.7.3
wand Image processing library 0.6.7
opencv OpenCV 4.5.4.58
numpy SciPy 1.21.4
scipy SciPy 1.7.2
matplotlib Matplotlib 3.4.3
scrapy Scrapy 2.5.1

Python 3(Python 3.6)

Module Description Module Version
oss2 OSS SDK 2.9.1
tablestore Tablestore SDK 5.1.0
aliyun-fc2 FC SDK 2.3.0
aliyun-python-sdk-ecs ECS SDK 4.10.1
aliyun-python-sdk-vpc VPC SDK 3.0.2
aliyun-python-sdk-rds RDS SDK 2.1.4
aliyun-python-sdk-kms KMS SDK 2.14.0
pydatahub DataHub SDK 2.11.2
aliyun-mns MNS SDK 1.1.5
aliyun-python-sdk-cdn CDN SDK 3.0.8
aliyun-python-sdk-ram RAM SDK 3.0.0
aliyun-python-sdk-sts STS SDK 3.0.0
aliyun-python-sdk-iot IoT SDK 7.8.0
aliyun-log-python-sdk SLS SDK 0.6.38
wand Image processing library 0.6.7
opencv OpenCV 3.3.0.10
numpy SciPy 1.13.3
scipy SciPy 1.0.0
matplotlib Matplotlib 2.0.2
scrapy Scrapy 1.4.0

References