Closed BuiQuocDung1991 closed 7 months ago
Hi, this seems like an issue with RDKit, the code cannot import RDKit modules. How do you run docking? Do you run code within a jupyter notebook? Could you provide the while code you run? We never tested how easydock worked in jupyter. However, the current error is linked to RDKit import.
I use anaconda as pakage manager and vscode in order to code with jupyter notebook (not jupyter in anaconda). After installing and activating easydock environment in anaconda prompt, i choose this kernel in vscode. After that, my code snippet is as below:
from easydock.run_dock import docking
from easydock.vina_dock import mol_dock
# from easydock.gnina_dock import mol_dock # <- enable gnina docking
from rdkit import Chem
smiles = ['CC(=O)O', 'NCC(=O)O', 'NC(C)C(=O)O']
mols = [Chem.MolFromSmiles(smi) for smi in smiles]
# assign names, because this will be an identifier of docking outputs of a molecule
for mol, smi in zip(mols, smiles):
mol.SetProp('_Name', smi)
for mol_id, res in docking(mols, dock_func=mol_dock, dock_config='config.yml', ncpu=4):
print(mol_id, res)
I want to run docking in python directly instead of in autodock.
The error is clearly in RDKit import. Try to import RDKit modules alone without any other code, you will get the same error. I believe the issue is in RDKit installation. For example
from rdkit.Chem import *
The issue is in RDKit installation. I have no idea what happened with rdkit. The proplem is in
from rdkit.Chem.rdmolfiles import *
What shoud i do to run easydock in python?
As I understood, you want to run easydock in an interactive mode using ipython. In this case I cannot advise something if you have an error with running RDKit. However, you may always use a command line python script. The one which we have in the package or write your own script which will satisfy your particular needs.
i think that the problem comes from python version 's compatibility. You can read the same problem here: https://github.com/rdkit/rdkit/discussions/6268
So, the solution would be to downgrade python version? On which python version it worked well? I still use 3.9 in all my environments.
Maybe, the issue is in the version of python. I have no idea exactly what happened but i guess. when i make new env environment with below codes:
conda create -n env python anaconda -y
conda install -c conda-forge rdkit -y
The version of python is 3.11
When i run jupiter in VS code, this error appeared:
ImportError: DLL load failed when importing Chem
Then i attempt to reinstall with below code (of course i removed the previous env environment)
conda create -c conda-forge -n env rdkit -y
The error disappeared with python 3.10.
Thank you for reporting this issue and the solution.
Hi everyone, I install easydock with the snippet of code in conda:
I run your python example, and the error appears