Installing the SDK
(Recommended) Installing the SDK Using pip
- Run the pip -V command to check the pip version and ensure that pip is installed.
- Run the pip install esdk-obs-python --trusted-host pypi.org command to start the installation.
- If pip has not been installed, install it following the instructions on pip official website.
- In a Windows operating system, the message "Not internal or external command" is displayed when you run the pip command. In this case, add the pip installation directory (generally the Scripts folder in the directory where the Python is located) to the Path environment variable.
- You may need to restart the computer for the environment variables to take effect.
Installing the SDK Using the Source Code
The following procedures show an example of installing the latest version of OBS Python SDK.
Method 1: direct installation
- Download the OBS Python SDK software package.
- 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).
- 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.
After the configuration, the directory structure is similar to the following:
├── examples
├── src
├── log.conf
└── README.md
Method 2: using the setuptools
- Download the OBS Python SDK development 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 whether 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 when you re-install the SDK.
- If SDK modules cannot be loaded after you have performed the previous steps, you can directly add the absolute path of the src directory in OBS Python SDK to the sys.path list.
Last Article: Preparing a Development Environment
Next Article: Quickly Using the SDK
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.