Python libstdc++ conflict LD_PRELOAD

If importing Python modules or trying to run an Anaconda Python program like Spyder gives CXXABI errors, it can be due to a conflict between the system libstdc++ and the Anaconda libstdc++. Assuming Anaconda / Miniconda Python on Linux, try specifying the libstdc++ library in the conda environment by LD_PRELOAD.

Find the system libstdc++:

find /usr -name libstdc++.so.6

Suppose “/usr/lib64/libstdc++.so.6”. Set LD_PRELOAD environment variable in the conda environment:

conda env config vars set LD_PRELOAD=/usr/lib64/libstdc++.so.6

conda activate

Then retry the command / program.