Installing Python 3.8 on SLES 12 for Hue

You must install Python 3.8 on all hosts on which you want to run the Hue service after installing Cloudera Manager and before adding the services to your cluster.

Install the necessary developer tools such as gcc and make on your system.

Install the openssl package, and place its binaries in the /lib/ directory. This is needed for installing the MySQL client on MySQL and MariaDB databases.
  1. Download the openssl package on the host on which you want to install the Python 3.8 package and decompress the file:
    cd /opt wget https://www.openssl.org/source/openssl-1.0.2o.tar.gz
    tar -xzf openssl-1.0.2o.tar.gz
  2. Change directory to openssl-1.0.2o:
    cd cd openssl-1.0.2o
  3. Run the following commands to build and compile the files:
    ./config --shared
    make
    make install
  4. Copy the following files to the /lib/ directory:
    cp libcrypto.so /lib/
    cp libssl.so /lib/
    cp libcrypto.a /lib/
    cp libssl.a /lib/
    cp libcrypto.pc /lib/
    cp libssl.pc /lib/
    cp openssl.pc /lib/
  5. Delete the openssl-1.0.2o.tar.gz file that you had downloaded:
    rm ./openssl-1.0.2o.tar.gz
  6. Configure openssl as follows:
    custom_openssl = " --with-openssl=/opt/openssl-1.0.2o"
    ./configure --enable-shared[***CUSTOM-OPENSSL***]
Install the following packages before installing Python 3.8:
  • libffi-devel-gcc5
  • libbz2-devel
  • libzip2
  • libffi-devel
  • libz1
  • zlib-devel
zypper install -y libffi-devel-gcc5 libbz2-devel libzip2 libffi-devel libz1 zlib-devel
  1. SSH into the host system as a root user.
  2. Download Python 3.8 and decompress the package by running the following commands:
    cd /opt
    curl -O https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz
    tar -zxvf Python-3.8.12.tgz
  3. Change directory to where you decompressed the Python 3.8 package:
    cd /opt/Python-3.8.12
  4. Install Python 3.8 as follows:
    ./configure --enable-shared --prefix=[***CUSTOM-INSTALL-PATH***]
    The --enabled-shared option is used to build a shared library instead of a static library.
  5. Build Python 3.8 as follows:
    1. Run the make command to compile the files:
      make
    2. Run the following command to put the compiled files in the default location or in the custom location that you specified using the --prefix option:
      make install
    3. Copy the shared compiled library files (libpython3.8.so) to the /lib64/ directory:
      cp --no-clobber ./libpython3.8.so* /lib64/
      The --no-clobber option is used to prevent overwriting files.
    4. Change the permissions of the libpython3.8.so files as follows:
      chmod 755 /lib64/libpython3.8.so*
    If you see an error such as error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory, then run the following command:
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
  6. Change the permission of the Python 3.8 installation directory to 755 so that Hue and its related services can leverage the binary and the site packages, as follows:
    chmod -R 755 /usr/local/lib/python3.8
  • (For Hue) If you have installed Python 3.8 at a custom location, then you must append the custom path in Cloudera Manager > Clusters > Hue > Configuration > Hue Service Environment Advanced Configuration Snippet (Safety Valve) separated by colon (:) as follows and restart the Hue service:

    Key: PATH

    Value: [***CUSTOM-INSTALL-PATH***]:/usr/local/sbin:/usr/local/bin:/usr/sbin:

  • Clean up the compiled openssl artifacts by running the following commands:
    rm /lib/libcrypto.so
    rm /lib/libssl.so
    rm /lib/libcrypto.a
    rm /lib/libssl.a
    rm /lib/libcrypto.pc
    rm /lib/libssl.pc
    rm /lib/openssl.pc