OpenChemistry / avogadrolibs

Avogadro libraries provide 3D rendering, visualization, analysis and data processing useful in computational chemistry, molecular modeling, bioinformatics, materials science, and related areas.
https://two.avogadro.cc/
BSD 3-Clause "New" or "Revised" License
438 stars 166 forks source link

Cannot load script /usr/local/lib/avogadro2/scripts/energy/ani2x.py #1620

Open yurivict opened 7 months ago

yurivict commented 7 months ago

Avogadro version: (please complete the following information from the About box):

Desktop version: (please complete the following information):

Describe the bug These errors are printed at startup (context before and after is added):

"obabel"  found:  "obabel: Open Babel 3.1.1 -- Feb  4 2024 -- 00:51:06"
"Checking for energy scripts in path /home/yuri/.local/share/OpenChemistry/Avogadro/energy"
"Checking for energy scripts in path /usr/local/share/OpenChemistry/Avogadro/energy"
"Checking for energy scripts in path /usr/share/OpenChemistry/Avogadro/energy"
"Checking for energy scripts in path /usr/local/bin/../lib/avogadro2/scripts/energy"
"Cannot load script /usr/local/lib/avogadro2/scripts/energy/ani2x.py"
"Cannot load script /usr/local/lib/avogadro2/scripts/energy/gaff.py"
"Cannot load script /usr/local/lib/avogadro2/scripts/energy/gfn1.py"
"Cannot load script /usr/local/lib/avogadro2/scripts/energy/gfn2.py"
"Cannot load script /usr/local/lib/avogadro2/scripts/energy/gfnff.py"
"Cannot load script /usr/local/lib/avogadro2/scripts/energy/mmff94.py"
"Cannot load script /usr/local/lib/avogadro2/scripts/energy/uff.py"
 registering obmm plugins
"Checking for commands scripts in path /home/yuri/.local/share/OpenChemistry/Avogadro/commands"

It doesn't say what the problem is. These Python scripts can be executed/loaded fine as standalone files.

welcome[bot] commented 7 months ago

Thanks for opening your first issue here! Please try to include example files and screenshots if possible. If you're looking for support, please post on our forum: https://discuss.avogadro.cc/

ghutchis commented 7 months ago

It's not a bug. If you don't have torchani installed, ani2x.py won't run - simply a warning. Similar with openbabel and gaff / mmff94 / uff and xtb-python and the gfn* scripts.

Since some people seem put off by the messages, we'll switch them to being separate plugin downloads.

yurivict commented 7 months ago

Is it this torchani?

ghutchis commented 7 months ago

Yes, exactly. It's not required for avogadro though.

yurivict commented 7 months ago

Ok, thanks.

ghutchis commented 7 months ago

Of course - feedback / bug reports always appreciated!

yurivict commented 7 months ago

IMO, you should first test that torchani is installed, and only then run these scripts. This way such error messages would only mean real errors. And if torchani isn't available, it should say so and it should say what functionality is disabled because of this reason.

This way it would be less confusing and more informative.

ghutchis commented 7 months ago

avogadro has no way of knowing what packages a script will attempt to load.

I'll see what we can do to tweak the error messages on the script side.

yurivict commented 7 months ago

But you know what is in this script because it is installed by your package.

avo-bot commented 7 months ago

This issue has been mentioned on Avogadro Discussion. There might be relevant details there:

https://discuss.avogadro.cc/t/full-and-privileged-xtb-integration/4953/70