Installing Python 3.8 on CentOS 7 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.
If you are using Oracle Enterprise Linux (OEL) 7, CentOS 7, RHEL 7, then you must install Python 3.8 and then install the psycopg2-binary package for using PostgreSQL as a backend database for Hue.
Install the necessary developer tools such as
make on your system.
Install the following packages before installing Python 3.8:
yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel -y
- SSH into the host system as a root user.
Change directory to /opt:
Download Python 3.8 as follows:
curl -O https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz
Decompress the package as follows:
tar -zxvf Python-3.8.12.tgz
Install Python 3.8 as follows:
--enabled-sharedoption is used to build a shared library instead of a static library.
Build Python 3.8 as follows:
If you see an error such as
makecommand to compile the files:
Run the following command to put the compiled files in the default
location or in the custom location that you specified using the
Copy the shared compiled library files (libpython3.8.so) to the
cp --no-clobber ./libpython3.8.so* /lib64/The
--no-clobberoption is used to prevent overwriting files.
Change the permissions of the libpython3.8.so files as follows:
chmod 755 /lib64/libpython3.8.so*
error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory, then run the following commands:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/ echo $PATH
- Run the
Change the permission of the Python 3.8 installation directory to
755so that Hue and its related services can leverage the binary and the site packages, as follows:
chmod -R 755 /usr/local/lib/python3.8