This topic describes how to build a Python development environment on an on-premises machine to run VPC SDK for Python demos. Alibaba Cloud SDK for Python supports Python 2.7 and 3.x. Before you can run VPC SDK for Python demos, you must install the core library of Alibaba Cloud SDK for Python and VPC SDK for Python. Alibaba Cloud SDK for Python supports Windows, Linux, and Mac. All VPC SDK for Python demos in this example run on the Windows operating system.

Procedure

  1. Install Python.
    This example shows how to install Python 3.9.6 on Windows.
    1. Open the download link of Python.
    2. Download Python 3.9.6.
    3. After you download Python 3.9.6, double-click the installation package to open the wizard. Use the default settings and select Add Python 3.9 to PATH.
    4. Click Install Now to install Python.
    5. After the installation is complete, click Close.
    6. In the cmd command prompt, run the python command. After Python is installed, the Python interactive environment is launched. In this case, the following output is displayed:
      Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] on win32
      Type "help", "copyright", "credits" or "license" for more information.
      >>>                       
  2. In the cmd command prompt, run the following command to install the core library of Alibaba Cloud SDK for Python.
    Note Alibaba Cloud SDK for Python supports the original SDK and the upgraded SDK. In this example, the upgraded SDK is installed.
    pip install alibabacloud_tea_openapi

    For more information about Python and PIP, see Python documentation and PIP documentation.

  3. In the cmd command prompt, run the following command to install alibabacloud_vpc20160428:
    pip install alibabacloud_vpc20160428==2.0.0