Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install issues , transformer module, involves pandas #96

Open
1 task done
DocMinus opened this issue Mar 16, 2024 · 2 comments
Open
1 task done

Install issues , transformer module, involves pandas #96

DocMinus opened this issue Mar 16, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@DocMinus
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and found nothing

Bug description

Tested two installation, following the description in README. Windows 10 and have problems with molfeat.trans, similar, yet different errors:
WSL Ubuntu 22: using mamba, and a new environment, Py3.10 the import attempt for from molfeat.trans import MoleculeTransformer leads to following error shown in error window.

Did a pip ... [all] just in case, but get the same error.

On a Windows conda with py3.10 I also get an error for Pandas, but not equally "bad", the code runs ok, but still gives error (or, well, warning) when I import.
upon from molfeat.trans import MoleculeTransformer I "only" get this:

Failed to find the pandas get_adjustment() function to patch
Failed to patch pandas - PandasTools will have limited functionality

then after the line of the example code mol_trans(data):

Failed to find the pandas get_adjustment() function to patch
Failed to patch pandas - PandasTools will have limited functionality
....multiple times...

How to reproduce the bug

WSL Windows 10 Ubuntu 22 install. Fresh conda installation, mamba ontop of that, creation of new environment, then followed the instructions here, then run the example code.
The Win10 environment: conda install (no mamba) and pip directly.

Error messages and logs

Error from WSL Ubuntu

 File "<stdin>", line 1, in <module>
  File "/home/a/mambaforge/envs/molstuff/lib/python3.10/site-packages/molfeat/trans/__init__.py", line 1, in <module>
    from molfeat.trans.concat import FeatConcat
  File "/home/a/mambaforge/envs/molstuff/lib/python3.10/site-packages/molfeat/trans/concat.py", line 15, in <module>
    from molfeat.trans.fp import FPVecTransformer
  File "/home/a/mambaforge/envs/molstuff/lib/python3.10/site-packages/molfeat/trans/fp.py", line 12, in <module>
    from molfeat.trans.base import MoleculeTransformer
  File "/home/a/mambaforge/envs/molstuff/lib/python3.10/site-packages/molfeat/trans/base.py", line 31, in <module>
    from molfeat.utils.cache import _Cache, FileCache, MPDataCache
  File "/home/a/mambaforge/envs/molstuff/lib/python3.10/site-packages/molfeat/utils/cache.py", line 35, in <module>
    class MolToKey:
  File "/home/a/mambaforge/envs/molstuff/lib/python3.10/site-packages/molfeat/utils/cache.py", line 39, in MolToKey
    "dm.unique_id": dm.unique_id,
  File "/home/a/mambaforge/envs/molstuff/lib/python3.10/site-packages/datamol/__init__.py", line 186, in __getattr__
    mod = importlib.import_module(obj_mod)
  File "/home/a/mambaforge/envs/molstuff/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/a/mambaforge/envs/molstuff/lib/python3.10/site-packages/datamol/mol.py", line 33, in <module>
    from .convert import to_inchikey_non_standard
  File "/home/a/mambaforge/envs/molstuff/lib/python3.10/site-packages/datamol/convert.py", line 15, in <module>
    from rdkit.Chem import PandasTools
  File "/home/a/mambaforge/envs/molstuff/lib/python3.10/site-packages/rdkit/Chem/PandasTools.py", line 653, in <module>
    InstallPandasTools()
  File "/home/a/mambaforge/envs/molstuff/lib/python3.10/site-packages/rdkit/Chem/PandasTools.py", line 622, in InstallPandasTools
    PandasPatcher.patchPandas()
  File "/home/a/mambaforge/envs/molstuff/lib/python3.10/site-packages/rdkit/Chem/PandasPatcher.py", line 263, in patchPandas
    if getattr(pandas_formats.format, get_adjustment_name) != patched_get_adjustment:
AttributeError: module 'pandas.io.formats.format' has no attribute 'get_adjustment'

Environment

Current environment
#- Molfeat version (e.g., 0.1.0):
#- PyTorch Version (e.g., 1.10.0):
#- RDKit version (e.g., 2022.09.5): 
#- scikit-learn version (e.g.,  1.2.1): 
#- OS (e.g., Linux):
#- How you installed Molfeat (`conda`, `pip`, source):

Additional context

No response

@DocMinus DocMinus added the bug Something isn't working label Mar 16, 2024
@cwognum
Copy link
Contributor

cwognum commented Mar 19, 2024

We had a similar issue in Polaris! This seems to be an upstream issue. get_adjustment() was moved to pandas.io.formats.printing in this PR. It was fixed in RDKit in this PR.

I believe this could be fixed by either setting an upper limit for pandas <2.2.0 or by setting a lower limit for rdkit > 2023.09.6. I am not sure which one should be preferred.

@cwognum
Copy link
Contributor

cwognum commented Mar 19, 2024

Since these two releases are fairly recent, you probably break less by setting an upper limit for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants