ImportError: libbz2.so.1.0: cannot open shared object file: No such file or directory || ONLY IN PYCHARM

Viewed 1066

I am using PyCharm on a fresh Linux installation. Every time I try to import librosa, pandas (or some other packages) I get the error:

ImportError: libbz2.so.1.0: cannot open shared object file: No such file or directory

The weird thing is that it works without any problems in the terminal. In PyCharm, however, it does not work.

I already tried to add the directory under which libbz2.so.1.0 is installed (/usr/lib/x86_64-linux-gnu) to the LD_LIBRARY_PATH.
I did that in my PyCharm run configuration and in the .bashrc.

Clearly, it is installed correctly in my packages, otherwise, I couldn't use it in the terminal so I don't know what else I can do.

2 Answers

Fixed it...

I initially installed pycharm via the software manager of linux mint. Apparently, that was a mistake.

The error disappeared when I installed it based on the instructions given by jetbrains.com.

cent os version 7.

it worked for me

ln -s /usr/lib64/libbz2.so.1.0.6 /usr/lib64/libbz2.so.1.0
Related