I did not have sudo access to my CentOS machine, so I installed gcc with conda. If you installed gcc with conda, the above answer will not work. check the gcc installation path as:
$ which gcc
output: /home/ags/miniconda3/envs/GE/bin/gcc
This indicates that gcc is installed in the GE conda environment, now export LD_LIBRARY_PATH as the path to the lib directory of this environment.
export LD_LIBRARY_PATH=/home/ags/miniconda3/envs/GE/lib:$LD_LIBRARY_PATH
Hope this helps.
source share