Skip to content

Seeking Help with TorchANI Installation and ANIAngular/ANIRadial in Legolas #5

@Chemistry-Mike

Description

@Chemistry-Mike

Hello,

I'm attempting to run the Legolas legolas.py script and am encountering a persistent ImportError related to torchani. I cloned the repository, installed the environment using conda (attempting both legolas_env.yaml and cpu_env.yaml). I ensured that the packages were installed, but when I installed torchANI, the script consistently fails on the line: from torchani.aev import AEVComputer, ANIAngular, ANIRadial.

I've attempted several steps to resolve this, suspecting a dependency mismatch. Here is a summary of the environment setups and installation attempts I've tried:

[1] Attempt with Python 3.10:

    I began by using python==3.10 and torchani==0.9. This immediately produced the ImportError.
    I also tried to install torchani==0.9.1 but pip indicated no matching distribution for that version.
    I then created a new Conda environment from a provided cpu_env.yaml file, which ended up installing torchani==2.2.4. This also produced the same ImportError, as the ANIAngular class was removed in torchani 2.0.

[2] Attempt with Python 3.7 (more compatible):

    I created a clean Conda environment with python==3.7.
    I installed all required dependencies incrementally: numpy, pandas, mdtraj, and biopython. The script progressed past each import line.
    I then installed torchani==0.9 and torch==1.5.0 to ensure version compatibility.
    Despite these steps, the script still failed with the same ImportError: cannot import name 'ANIAngular' from 'torchani.aev'.

It seems that even when I explicitly install torchani==0.9 using pip, the package that is installed does not contain the ANIAngular class. This is perplexing, as this class should exist in the 0.9 version of the library.

Could you please confirm the exact versions of torchani and torch that are known to be compatible with this script? Is there a specific channel or installation method I should be using? Any assistance you can provide would be greatly appreciated.

Thank you for your time and for creating Legolas.

Best,

Michael

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions