Crystal Toolkit offers integration with JupyterLab to allow easy viewing of crystal structures and other Materials Project data interactively.
There are two steps to using Crystal Toolkit inside Jupyter:
Make sure Jupyter Lab is installed and run using
jupyter lab, version 3.x. Crystal Toolkit is not supported in the older Jupyter notebooks or older versions of Jupyter Lab.
Ensure Crystal Toolkit is installed as normal,
pip install crystal-toolkit --upgrade
Install the Crystal Toolkit extension in the same environment you run
jupyter labfrom using
jupyter labextension install crystaltoolkit-extension
Restart Jupyter Lab completely. You be asked to perform a “build,” click OK and it’s normal for this to take a minute. After this it’s ready to use!
To use, simply
import crystal_toolkit and use
pymatgen as normal for crystal structures
to be shown using Crystal Toolkit.