Downloading and Installing an SDK (SDK for Python)
This section describes how to download and install the OBS SDK for Python.
Downloading OBS SDK for Python
Latest version of OBS Python SDK source code: Download
Installing OBS SDK for Python
You can use the methods listed in Table 1 to install OBS SDK for Python.
Method 1: (Recommended) Installing the SDK Using pip
- Run the pip -V command to check that pip of the correct version is installed.
- Run pip install esdk-obs-python --trusted-host pypi.org to start the SDK installation.
- If pip has not been installed, install it following the instructions on the pip official website.
- If the message "Not internal or external command" is displayed when you run the pip command in a Windows OS, add the pip installation directory (generally the Scripts folder in the directory where the Python is located) to the Path environment variable and restart the computer for the environment variable to take effect.
Method 2: Installing the SDK Using the Source Code
The following procedure shows how to install the latest version of OBS Python SDK.
- Download the SDK package and decompress it.
- Run pip install pycryptodome==3.10.1 to install the cryptographic library.
- Decompress the development package to obtain the src folder (SDK source code), the examples folder (sample code), the README.md file (feature description file of SDK versions), and the log.conf file (SDK log configuration file).
- 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 to integrate OBS Python SDK into the project.
After the configuration, the directory structure is similar to the following:
├── examples
├── src
├── log.conf
└── README.md
Method 3: Installing the SDK Using setuptools
The following procedure shows how to install the latest version of OBS Python SDK.
- Download the SDK package and decompress it.
- Download and install setuptools.
- On the command-line interface (CLI), go to folder src under the directory where the development package is decompressed.
- Run the python setup.py install command to install the SDK.
- After the installation, check that a folder named esdk_obs_python-<versionId>-*.egg is generated in Lib/site-package under the Python installation directory.
- If you use this method to install the SDK, you need to delete folder esdk_obs_python-<versionId>-*.egg before re-installing the SDK.
- If the SDK modules still cannot be loaded after completing the preceding steps, add the absolute path of the src directory in the OBS Python SDK to Python's module search path (sys.path).
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot