Interactive 3D graphics for the Jupyter Notebook and JupyterLab, using Three.js and Jupyter Widgets.
Project description
pythreejs
A Python / ThreeJS bridge for Jupyter Widgets.
Installation
Using pip
:
pip install pythreejs
or conda
:
conda install -c conda-forge pythreejs
For a development install, see the contributing guide.
The extension should then be installed automatically for your Jupyter client.
For JupyterLab
<3
, you may also need to ensurenodejs
is installed, and rebuild the application:# conda install -c cond-forge 'nodejs>=12' jupyter lab build
Troubleshooting
If the extension is not automatically installed, you can manually enable it
Jupyter Notebook Classic
jupyter nbextension list
jupyter nbextension install --py --symlink --sys-prefix pythreejs
jupyter nbextension enable --py --sys-prefix pythreejs
jupyter nbextension list
You should see:
Known nbextensions:
...
jupyter-js-widgets/extension enabled
- Validating: OK
Note for developers: the
--symlink
argument on Linux or MacOS allows one to modify the JavaScript code in-place. This feature is not available on Windows.
JupyterLab
To perform a source installation:
## ensure you have nodejs install, e.g. with conda
# conda install -c conda-forge 'nodejs>=12'
jupyter labextension list
jupyter labextension install --no-build @jupyter-widgets/jupyterlab-manager
jupyter labextension install --no-build jupyter-datawidgets/extension
jupyter labextension install jupyter-threejs
jupyter labextension list
You should see:
JupyterLab v...
...
jupyterlab-datawidgets v... enabled OK
@jupyter-widgets/jupyterlab-manager v... enabled OK
jupyter-threejs v... enabled OK
This approach is not recommended for JupyterLab 3, which enables federated modules, installed via
pip
,conda
or other package managers, and does not require rebuilding the entire application.
Uninstallation
Using pip
:
pip uninstall pythreejs
or conda
:
conda uninstall pythreejs
If you applied any manual steps above, it may be necessary to remove the
Jupyter Notebook Classic
jupyter nbextension disable --py --sys-prefix pythreejs
Jupyter Lab
jupyter labextension uninstall jupyter-threejs
Open Source
This software is licensed under the BSD-3-Clause License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pythreejs-2.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d1e661a8dd7b5eef8a14617716180ac2bbe70b634c249394acc2564e52dcf33 |
|
MD5 | a96f1bff6aec80d0ad638b4499f886e1 |
|
BLAKE2b-256 | 33057e3e5f96a5387a26c1ff5da7a7a1cacd618097e52c0b2947da05a2434af5 |