Installing Python
Introduction
Currently, the Vision SDK package depends on Python. If Python is not configured in the environment, perform the following steps to install it. The following describes how to install Python 3.9.2 as the root user.
Procedure
- Install the Python 3.9.2 dependencies. The following uses Ubuntu as an example:
1apt-get install -y build-essential gcc g++ make cmake zlib1g zlib1g-dev libsqlite3-dev openssl libssl-dev libffi-dev unzip pciutils net-tools libblas-dev gfortran libblas3 libopenblas-dev
- Download the Python 3.9.2 source installation package.
1wget https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tgz - Decompress the Python 3.9.2 installation package.
1tar -zxvf Python-3.9.2.tgz --no-same-owner
- Compile and install Python 3.9.2.
1cd Python-3.9.2 && ./configure --prefix=/usr/local/python3.9.2 --enable-shared && make -j8 && make install
- Copy libpython3.9.so.1.0 to the system path.
1cp /usr/local/python3.9.2/lib/libpython3.9.so.1.0 /usr/lib
- Set the environment variables.
1 2
export LD_LIBRARY_PATH=/usr/local/python3.9.2/lib:$LD_LIBRARY_PATH export PATH=/usr/local/python3.9.2/bin:$PATH
If the error message "No module named 'dnf'" is displayed when you run the yum command after Python 3.9.2 is installed using the source code, delete the Python path from LD_LIBRARY_PATH and use the Python path of the system.
Parent topic: Dependency Installation