microsoft / Graphormer

Graphormer is a general-purpose deep learning backbone for molecular modeling.
MIT License
2.08k stars 334 forks source link

unable to import PygPCQN4MDataset #43

Open aahad5555 opened 2 years ago

aahad5555 commented 2 years ago

hi, I am having trouble importing PygPCQN4MDataset, I ran the following line of code from ogb.lsc.pcqm4m_pyg import PygPCQM4MDataset and it threw this error ImportError: cannot import name 'smiles2graph' from 'ogb.utils' (/usr/local/lib/python3.7/dist-packages/ogb/utils/__init__.py). I am trying to run it the code on colab and fulfilled requirements of code but this error poped up.

zhengsx commented 2 years ago

It seems an exteranl dependence problem. Do you use the required environment?

aahad5555 commented 2 years ago

yes, I installed everything that was recommended. Is it something to do with colab?

zhengsx commented 2 years ago

We have not tested our code on colab. If I remember right, colab will pre-install several commonly-used depencencies, which might cause a version conflict. Maybe you can try in a clean conda environment or a docker.

aahad5555 commented 2 years ago

okay I will check it. Thanks for the timely reply. It means a lot.

shiokoo commented 2 years ago

okay I will check it. Thanks for the timely reply. It means a lot.

Did you solve it? I also encountered this problem.

aahad5555 commented 2 years ago

@shiokoo yeah, if you are working on colab than don't install requirements at once. Only install packages which are not preinstalled on colab plus it seemed I didn't installed rdkit .

shiokoo commented 2 years ago

@shiokoo yeah, if you are working on colab than don't install requirements at once. Only install packages which are not preinstalled on colab plus it seemed I didn't installed rdkit .

Oh, I try it on PyCharm, although I install rdkit, the error still exists. Anyway, thanks you a lot.

laowu-code commented 2 years ago

@shiokoo Sorry to bother you,I encountered the same error,how did you solve it? Thanks a lot.

shiokoo commented 2 years ago

@shiokoo Sorry to bother you,I encountered the same error,how did you solve it? Thanks a lot.

yeah, I solved it. This may be a version problem of rdkit that rdkit.Chem can't be imported. You can re-install rdkit, using following command:

conda install rdkit -c conda-forge

after that, if you still have some bugs, maybe the following command will help you.

apt-get install libxrender1

laowu-code commented 2 years ago

@shiokoo Sorry to bother you,I encountered the same error,how did you solve it? Thanks a lot.

yeah, I solved it. This may be a version problem of rdkit that rdkit.Chem can't be imported. You can re-install rdkit, using following command:

conda install rdkit -c conda-forge

after that, if you still have some bugs, maybe the following command will help you.

apt-get install libxrender1

Thank you for your prompt response, it means a lot to me.