• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. Developer Guide (Python SDK)
  4. Quick Start
  5. Installing the SDK

Installing the SDK

The following uses OBS Python SDK of the latest version as an example:

  1. Download the OBS Python SDK development package by referring to Downloading the SDK.
  2. Decompress the development package to obtain folder src (SDK source code), folder examples (sample code), file README.txt (feature description file of SDK versions), and file log.conf (SDK log configuration file).
  3. Use PyCharm to create a project, copy the folders and files obtained in the previous step to the project, right-click folder src, and choose Mark Directory as > Sources Root.

    NOTE:

    After the configuration, the directory structure is similar to the following:

    ├── examples

    ├── src

    ├── log.conf

    └── README.txt

Alternatively, you can use setuptools to install the SDK development package as follows:

  1. Download the OBS Python SDK development package and decompress it.
  2. Download and install setuptools.
  3. On the command-line interface (CLI), go to folder src under the directory where the development package is decompressed.
  4. Run the python setup.py install command to install the SDK.
  5. After the installation, check whether a folder named esdk_obs_python-<versionId>-*.egg is generated in Lib/site-package under the Python installation directory.

    NOTE:
    • If you use this method to install the SDK, you need to delete folder esdk_obs_python-<versionId>-*.egg when you re-install the SDK.
    • If SDK modules cannot be loaded after you have performed the previous steps, you can directly add absolute path of the src directory in OBS Python SDK to the sys.path list.