MolecularAI / REINVENT4

AI molecular design tool for de novo design, scaffold hopping, R-group replacement, linker design and molecule optimization.
Apache License 2.0
325 stars 79 forks source link

Unable to install specific commit using pip #72

Closed ankitskvmdam closed 2 months ago

ankitskvmdam commented 5 months ago

I am getting the following error when I try to install specific commit of REINVENT4.

Looking in indexes: https://pypi.org/simple, https://pypi.anaconda.org/OpenEye/simple, https://download.pytorch.org/whl/cu113
Collecting git+https://github.com/MolecularAI/REINVENT4@ee87830e800af22f17b05027bb9378950d5980f7
  Cloning https://github.com/MolecularAI/REINVENT4 (to revision ee87830e800af22f17b05027bb9378950d5980f7) to c:\users\ankit\appdata\local\temp\pip-req-build-8zinxd39
  Running command git clone --filter=blob:none --quiet https://github.com/MolecularAI/REINVENT4 'C:\Users\ankit\AppData\Local\Temp\pip-req-build-8zinxd39'
  Encountered 11 files that should have been pointers, but weren't:
        contrib/reinvent_plugins/components/NIBRSubstructureFilters/catalog.pkl
        priors/libinvent.prior
        priors/linkinvent.prior
        priors/mol2mol_high_similarity.prior
        priors/mol2mol_medium_similarity.prior
        priors/mol2mol_mmp.prior
        priors/mol2mol_scaffold.prior
        priors/mol2mol_scaffold_generic.prior
        priors/mol2mol_similarity.prior
        priors/pubchem_ecfp4_with_count_with_rank_reinvent4_dict_voc.prior
        priors/reinvent.prior
  Running command git rev-parse -q --verify 'sha^ee87830e800af22f17b05027bb9378950d5980f7'
  Running command git fetch -q https://github.com/MolecularAI/REINVENT4 ee87830e800af22f17b05027bb9378950d5980f7
  Running command git checkout -q ee87830e800af22f17b05027bb9378950d5980f7
  error: Your local changes to the following files would be overwritten by checkout:
        priors/pubchem_ecfp4_with_count_with_rank_reinvent4_dict_voc.prior
  Please commit your changes or stash them before you switch branches.
  Aborting
  error: subprocess-exited-with-error

  × git checkout -q ee87830e800af22f17b05027bb9378950d5980f7 did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× git checkout -q ee87830e800af22f17b05027bb9378950d5980f7 did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Steps to reproduce

  1. Create a conda environment
conda create --name reinvent4 python=3.10
  1. Activate the env
conda activate reinvent4
  1. Run the following command:
pip install git+https://github.com/MolecularAI/REINVENT4@ee87830e800af22f17b05027bb9378950d5980f7 --extra-index-url=https://pypi.anaconda.org/OpenEye/simple --extra-index-url https://download.pytorch.org/whl/cu113

Other information:

OS: Windows 11 Shell: Powershell

halx commented 5 months ago

Hi,

Many thanks for your interest in REINVENT and welcome to the community!

Does installation from HEAD work? If so, why can't you install from HEAD and the checkout the commit you want?

Many thanks, Hannes.

ankitskvmdam commented 5 months ago

Hey @halx, thanks for your help!

Yes, it works when I install reinvent from HEAD. The reason I want to install specific version is as follows. I'm working on a tool that relies on reinvent 4. My env.yml file:

name: envname
channels:
  - defaults
dependencies:
  - python=3.10
  - jupyter
  - pip:
    - rdkit
    - --extra-index-url https://pypi.anaconda.org/OpenEye/simple
    - --extra-index-url https://download.pytorch.org/whl/cu113
    - git+https://github.com/MolecularAI/REINVENT4.git

This was working fine up to v4.2.8. However in v4.3.0, there is cu121 instead of cu113. Due to this issue, my build was failing. I found a workaround by adding --extra-index-url https://download.pytorch.org/whl/cu121, but I'm looking for a more future-proof solution. Thinking of installing a specific commit every time instead of relying on the latest release. What do you think?

halx commented 4 months ago

I think the issue here is that you have decided to do the dependence management yourself which is fine of course but ultimately it is our requirements file that determines that. I just see that the reason why your checkout fails is actually a local change to the repo of yours and git fails to merge.

BTW, may I ask what tool you are developing?

ankitskvmdam commented 4 months ago

@halx Thanks for your reply.

This is the tool: https://github.com/ersilia-os/eos694w

I have found a work around to deal with this (cloning the repository and then checkout to specific version instead of using pip).

Yes, the message says that there is some change in the local, however I have nothing in the local, It was failing in an empty directory when I ran pip install.

Attaching link to google collab reproducing the same bug.