atomistic-machine-learning / schnetpack-gschnet

G-SchNet extension for SchNetPack
MIT License
45 stars 8 forks source link

SchNetPack/PyTorch Dependency Conflicts #2

Closed shaychaudhuri closed 1 year ago

shaychaudhuri commented 1 year ago

Hi,

I'm experiencing some dependency conflicts and the installation instructions for the repository might need updating. schnetpack 2.0.0 requires pytorch-lightning>=1.8.1 but pytorch_lightning.loggers.base.LightningLoggerBase has been deprecated since v1.7.0. This results in the following ImportError: cannot import name 'LightningLoggerBase' from 'pytorch_lightning.loggers'. I've followed the provided installation instructions so the error should be reproducible. Any advice would be very appreciated!

Many thanks, Shay

NiklasGebauer commented 1 year ago

Hi Shay,

thanks for pointing that out! The error occurs in schnetpack due to changes in the API of pytorch-lightning. You have several options to circumvent this problem:

  1. Install pytorch-lightning==1.8.1 manually before you install schnetpack-gschnet (since LightningLoggerBase was only removed in later versions).
    git clone https://github.com/atomistic-machine-learning/schnetpack-gschnet.git
    conda create -n gschnet numpy
    conda activate gschnet
    pip install pytorch-lightning==1.8.1
    pip install ./schnetpack-gschnet
  2. Alternatively, install schnetpack from source before you install schnetpack-gschnet (since the problem is already fixed in the most recent version of schnetpack).
    git clone https://github.com/atomistic-machine-learning/schnetpack-gschnet.git
    git clone https://github.com/atomistic-machine-learning/schnetpack.git
    conda create -n gschnet numpy
    conda activate gschnet
    pip install ./schnetpack
    pip install ./schnetpack-gschnet

Also, we will update the pip release of schnetpack as soon as possible. I will update this issue accordingly.

shaychaudhuri commented 1 year ago

Perfect, yup that seems to have resolved the issue. Thanks Niklas!

NiklasGebauer commented 1 year ago

Finally closing this issue as SchNetPack has been updated to version 2.0.1 lately and the pip-wheel should not cause conflicts anymore.