Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error displaying widget in Jupyter notebook #139

Closed
Versallius opened this issue Oct 17, 2023 · 8 comments
Closed

Error displaying widget in Jupyter notebook #139

Versallius opened this issue Oct 17, 2023 · 8 comments

Comments

@Versallius
Copy link

Versallius commented Oct 17, 2023

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
Copy link
Contributor

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

@Versallius
Copy link
Author

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
Copy link
Author

Versallius commented Oct 23, 2023

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
Copy link
Contributor

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
Copy link

Enache-David commented Nov 26, 2023

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
Copy link
Contributor

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

@Enache-David
Copy link

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

@SGenheden
Copy link
Contributor

Fixed by #141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants