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

Google colab gives weird error when gemmi/spglib are imported #192

Open
tkittel opened this issue Sep 4, 2024 · 0 comments
Open

Google colab gives weird error when gemmi/spglib are imported #192

tkittel opened this issue Sep 4, 2024 · 0 comments
Labels

Comments

@tkittel
Copy link
Member

tkittel commented Sep 4, 2024

As discussed with @marquezj @dddijulio:

In a google colab environment where ncrystal, gemmi, and spglib are all pip installed, using the NCrystal cifutils results in warnings when gemmi or spglib are imported by NCrystal:

Querying the Crystallography Open Database for entry 9008590
<frozen importlib._bootstrap>:914: ImportWarning: _PyDrive2ImportHook.find_spec() not found; falling back to find_module()
<frozen importlib._bootstrap>:914: ImportWarning: _PyDriveImportHook.find_spec() not found; falling back to find_module()
<frozen importlib._bootstrap>:914: ImportWarning: _GenerativeAIImportHook.find_spec() not found; falling back to find_module()
<frozen importlib._bootstrap>:914: ImportWarning: _OpenCVImportHook.find_spec() not found; falling back to find_module()
<frozen importlib._bootstrap>:914: ImportWarning: APICoreClientInfoImportHook.find_spec() not found; falling back to find_module()
<frozen importlib._bootstrap>:914: ImportWarning: _BokehImportHook.find_spec() not found; falling back to find_module()
<frozen importlib._bootstrap>:914: ImportWarning: _AltairImportHook.find_spec() not found; falling back to find_module()
Adding cod_9008590.cif to local file cache in $NCRYSTAL_ONLINEDB_CACHEDIR
Attempting to load CIF data with gemmi
Self-consistency of structure was verified by spglib
<frozen importlib._bootstrap>:914: ImportWarning: _PyDrive2ImportHook.find_spec() not found; falling back to find_module()
<frozen importlib._bootstrap>:914: ImportWarning: _PyDriveImportHook.find_spec() not found; falling back to find_module()
...

If we explictly import gemmi + spglib earlier in the notebook, these warnings disappear.

The question is whether or not we are doing something wrong, or if there is an easy and maintainable way to get rid of them by modifying the NCrystal importing code (we could of course suppress them)

@tkittel tkittel added the bug label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant