Graphormer icon indicating copy to clipboard operation
Graphormer copied to clipboard

unable to import PygPCQN4MDataset

Open aahad5555 opened this issue 4 years ago • 10 comments

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.

aahad5555 avatar Dec 01 '21 15:12 aahad5555

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

zhengsx avatar Dec 02 '21 02:12 zhengsx

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

aahad5555 avatar Dec 02 '21 05:12 aahad5555

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.

zhengsx avatar Dec 02 '21 06:12 zhengsx

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

aahad5555 avatar Dec 02 '21 07:12 aahad5555

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

Did you solve it? I also encountered this problem.

shiokoo avatar Dec 21 '21 06:12 shiokoo

@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 .

aahad5555 avatar Dec 21 '21 06:12 aahad5555

@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.

shiokoo avatar Dec 21 '21 07:12 shiokoo

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

laowu-code avatar Jul 26 '22 03:07 laowu-code

@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

shiokoo avatar Jul 26 '22 03:07 shiokoo

@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.

laowu-code avatar Jul 26 '22 03:07 laowu-code