Some background :
I faced the same issue recently.
My work is mostly on my university high performance cluster and therefore the libraries that I use for computation messes up my account a lot.
The solution that worked for me was to first check which libraries were loaded with
ldd /usr/bin/htop. My out was something like this:
linux-vdso.so.1 => (0x00007ffedfd87000)
libncursesw.so.5 => /usr/local/Anaconda/Anaconda3/lib/libncursesw.so.5 (0x00002b84c2bc2000)
libtinfo.so.5 => /usr/local/Anaconda/Anaconda3/lib/libtinfo.so.5 (0x00002b84c2df3000)
libm.so.6 => /lib64/libm.so.6 (0x00002b84c304f000)
libgcc_s.so.1 => /usr/local/Anaconda/Anaconda3/lib/libgcc_s.so.1 (0x00002b84c3352000)
libc.so.6 => /lib64/libc.so.6 (0x00002b84c3564000)
libtinfow.so.5 => /usr/local/Anaconda/Anaconda3/lib/./libtinfow.so.5 (0x00002b84c3931000)
It might not be very obvious but the dependencies were met through the Anaconda3 libraries, which is pretty awkward. I had asked to load anaconda module in my
~/.bashrc. This causes a mismatch in the libraries with the ones in the headers.
Solution was to simply unload the anaconda module with
module unload python/Anaconda3
P.S. This is a very specific solution that worked for me. Can you please write your out from