Closed jannisborn closed 2 years ago
A couple of minutes ago, I went through the Jupyter-notebooks of this project. Book "2-getting-started.ipynb" includes a SMILES-based search, which is working (even in Python 3). Can you replicate this on a computer accessible to you?
From the CLI in Linux Debian 12/bookworm:
Python 3.9.9 (main, Dec 16 2021, 23:13:29)
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pubchempy as pcp
>>> pcp.get_compounds('C1=CC2=C(C3=C(C=CC=N3)C=C2)N=C1', 'smiles')
[Compound(1318)]
>>>
``
The same code that was raising the error before (executed in the same env) now works fine again and gives the same result that you report. Seems like this was an API outage on pubchem side. Thanks for looking into this and building this useful library :)
Previously functioning code using
get_compounds
with the smiles argument is currently disfunctional.For example:
raises an
pubchempy.BadRequestError
. This does not happen when searching forname
and also not for substructure searches.Possible reason: A bug on pubchem side: The UI seems to have trouble standardizing SMILES atm: https://pubchem.ncbi.nlm.nih.gov/#query=C1=CC2=C(C3=C(C=CC=N3)C=C2)N=C1
What's going on here?