datamol-io / datamol

Molecular Processing Made Easy.
https://docs.datamol.io
Apache License 2.0
462 stars 48 forks source link

AttributeError: module `'rdkit.Chem.Draw'` has no attribute `'_okToKekulizeMol'` #146

Closed sgalpha01 closed 1 year ago

sgalpha01 commented 1 year ago

I recently joined the Slack community of M2D2. There someone suggested getting started with this video. I was following the first talk, which was on datamol. I spun a Colab instance to follow the talk and replicate the code. I faced a few problems while doing that.

  1. Conda is not installed in Colab, so I tried installing by ! pip install datamol. I got the following error while importing datamol: ModuleNotFoundError: No module named 'rdkit' My concern here: Shouldn't pip also install the rdkit dependency by default?

  2. I installed rdkit by ! pip install rdkit. Now I can import datamol successfully. But, if I try to run:

mol = dm.to_mol("CCO")
dm.to_image([mol], indices=True)

I'm getting the following error: AttributeError: module 'rdkit.Chem.Draw' has no attribute '_okToKekulizeMol'

hadim commented 1 year ago

The error related to _okToKekulizeMol is due to the latest recently released version of RDKit and it's fixed at https://github.com/datamol-org/datamol/pull/145.

I will release a new version of datamol in the next few hours.


Note that you can install conda with https://github.com/conda-incubator/condacolab


Shouldn't pip also install the rdkit dependency by default?

Yes you're right. Originally rdkit wasn't available on PyPi but now it is so we should add it.

hadim commented 1 year ago

@sgalpha01 I have just released datamol 0.8.0. Let me know if you have any more trouble.