I'm not a user of PyCharm.
It is hard to tell exactly what's going on, you provided very little information to even guess what may be wrong in your setup.
A probable cause of your issue is that the Python process running within PyCharm is not getting the LD_LIBRARY_PATH environment variable.
What Linux distro are you using?
How did you install PyCharm?
How did you configure the Python interpreter PyCharm is running?
How did you install the MPI implementation (which is MPICH, from the libmpi.so.12 shared library name)?