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

ImportError: cannot import name 'CalcPBF' from 'rdkit.Chem.rdMolDescriptors' #85

Open
ademidun opened this issue Apr 9, 2020 · 4 comments

Comments

@ademidun
Copy link

ademidun commented Apr 9, 2020

description

when I run the following line: from mordred import Calculator, descriptors

I get the following error:

ImportError: cannot import name 'CalcPBF' from 'rdkit.Chem.rdMolDescriptors'

Full traceback

properties.py:28: in <module>
     from mordred import Calculator, descriptors
 /usr/local/lib/python3.7/site-packages/mordred/descriptors/__init__.py:42: in <module>
     _import_all_descriptors()
 /usr/local/lib/python3.7/site-packages/mordred/descriptors/__init__.py:31: in _import_all_descriptors
     mdl = import_module(".." + name, __package__)
 /usr/lib64/python3.7/importlib/__init__.py:127: in import_module
     return _bootstrap._gcd_import(name[level:], package, level)
 /usr/local/lib/python3.7/site-packages/mordred/PBF.py:1: in <module>
     from rdkit.Chem.rdMolDescriptors import CalcPBF
 E   ImportError: cannot import name 'CalcPBF' from 'rdkit.Chem.rdMolDescriptors' (/usr/lib64/python3.7/site-packages/rdkit/Chem/rdMolDescriptors.so)

minimal reproduction code

from mordred import Calculator, descriptors

environment

OS/distribution

Linux fedora 34

conda or pip

pip.

python version

Please execute the command and paste result.

Python 3.7.6

library version

```.bash
python -m pip list
python -c 'import rdkit; print("rdkit " + rdkit.__version__)'
```
mordred==1.2.0
rdkit==2019.03.3 # this might be wrong, I think it's the latest version of rdkit
# our ci automatically installs the most recent version (currently that is 2020.03.1)`
@ademidun
Copy link
Author

ademidun commented Apr 9, 2020

Current workaround is rolling back to a previous version of mordred pip install mordred[full]==1.1.2

@supersciencegrl
Copy link

Hello! Yes, I am having this exact issue. I only just installed mordred for the first time and am not used to it. I am running rdkit on wsl via Windows, downloaded this morning from the Ubuntu repository.

Using mordred 1.1.2 as suggested above fixed this particular error (though mordred.tests still failed). I was using rdkit version 2019.09.1
All functions I've tried in rdkit.Chem.rdMolDescriptors that seem to come after CalcPBF() in the rdkit docs also seem to fail. The functions that appear before it work. It's as if something fails in the installation just before it gets to CalcPBF().
https://www.rdkit.org/docs/source/rdkit.Chem.rdMolDescriptors.html

I think it's not a mordred issue but an rdkit installation issue? But this is the only place I can find reference to it on the Internet, so I thought I'd post. I'm not an expert here so would be happy to hear alternative suggestions/opinions.

@lzming99
Copy link

lzming99 commented Jul 4, 2024

same here, and it seems they still did not fix this issue

@JacksonBurns
Copy link

I believe this error is fixed on our community-maintained fork of this repository, mordred-community: https://github.com/JacksonBurns/mordred-community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants