Moltemplate: ModuleNotFoundError: No module named 'moltemplate'

Dear all,
I was using Moltemplate to convert a pdb file to a data file for lammps simulation.
I have prepared lt files for all my molecules and system.lt file.
when I ran “moltemplate.sh -pdb model.pdb system.lt”, an error occurred:

moltemplate.sh v2.20.19 2022-2-06
Traceback (most recent call last):
File “/usr/local/bin/lttree_check.py”, line 5, in
from moltemplate.lttree_check import main
ModuleNotFoundError: No module named ‘moltemplate’

I have written two lines in .bashrc file:
export PATH=“$PATH:/home/mewu/Downloads/moltemplate_2023-2-06/moltemplate”
export PATH=“$PATH:/home/mewu/Downloads/moltemplate_2023-2-06/moltemplate/scripts”

And run “which moltemplate.sh” commands, it shows “/usr/local/bin/moltemplate.sh”

Any help would be much appreciated.

You need to remove the file (or link) moltemplate.sh from /usr/local/bin and only use the copy on your home.

Thanks. This solution worked. I can convert the file successfully.

Hello, I am getting exactly the same error. I have installed it using pip and moltemplate.sh is in the /envs/lammps/bin/ directory. I don’t have moltemplate.sh in the /usr/local/bin
. Why am I still getting the error? Any suggestions, please.

Impossible to say from remote. You don’t provide the exact steps (and files) needed to reproduce the exact error and we cannot know what is on your computer. Many times, people think they have the same error, when it is just similar, and also in many cases, the same error message can have different causes.