MolecularAI / aizynthfinder

A tool for retrosynthetic planning
https://molecularai.github.io/aizynthfinder/
MIT License
562 stars 128 forks source link

Error displaying widget in Jupyter notebook #139

Closed Versallius closed 7 months ago

Versallius commented 9 months ago

Followed instructions for installation and used the following code from this demo (https://github.com/MolecularAI/aizynthfinder/blob/master/contrib/notebook.ipynb):

from rdkit.Chem.Draw import IPythonConsole
from aizynthfinder.interfaces import AiZynthApp
application = AiZynthApp("./data/config.yml")

Results in the following output from Jupyter notebook:

Loading template-based expansion policy model from ..\Projects\RAScore\data\uspto_model.onnx to uspto
Loading templates from ..\Projects\RAScore\data\uspto_templates.csv.gz to uspto
Loading template-based expansion policy model from ..\Projects\RAScore\data\uspto_ringbreaker_model.onnx to ringbreaker
Loading templates from ..\Projects\RAScore\data\uspto_ringbreaker_templates.csv.gz to ringbreaker
Loading filter policy model from ..\Projects\RAScore\data\uspto_filter_model.onnx to uspto
Loading stock from ..\Projects\RAScore\data\zinc_stock.hdf5 to zinc
Selected as molecule cost: zero
Error displaying widget
Error displaying widget
Error displaying widget
Error displaying widget
SGenheden commented 9 months ago

Hmm. That was not a very informative error. What system are you running this on?

Versallius commented 9 months ago

This is on Windows 10. I'm not sure what else I can provide to help, but the environment was set up according to the README:

conda create "python>=3.8,<3.10" -n aizynth
conda activate aizynth
python -m pip install aizynthfinder[all]
download_public_data data

then installed Pillow=9.0.0 as in the notebook and then the block above. Everything else seems to run fine except for "Error displaying widget".

Versallius commented 9 months ago

Update:

It looks like the issue is being caused by the notebook v7 update in Jul 2023. Issue was solved by downgrading: pip install notebook==6.1.5 followed by: jupyter nbextension enable --py --sys-prefix widgetsnbextension

SGenheden commented 9 months ago

Thanks for finding a solution. It looks like we have to update the GUI to work with the more modern v7 notebooks. We will add that to our roadmap. @Lakshidaa

Enache-David commented 8 months ago

I installed ipywidgets and it fixed the issue even with the latest notebook (7.0.6) https://ipywidgets.readthedocs.io/en/7.x/user_install.html

SGenheden commented 8 months ago

Hello @Enache-David Can you elaborate on what you fixed?

Enache-David commented 8 months ago

The widgets were not displaying, instead there was the same error: "Error displaying widget". After installing ipywidgets the widgets appeared.

SGenheden commented 7 months ago

Fixed by #141