跳转到主要内容

为Jupyter Notebook和JupyterLab提供交互式3D图形,使用Three.js和Jupyter小部件。

项目描述

pythreejs

Interactive demo on Binder Install from PyPI Install from conda-forge Reuse from npm Documentation Status Build Status

Python / ThreeJS桥接Jupyter小部件

Screencast

安装

使用pip

pip install pythreejs

conda

conda install -c conda-forge pythreejs

对于开发安装,请参阅贡献指南

然后扩展应该会自动安装到您的Jupyter客户端。

对于JupyterLab <3,您还可能需要确保已安装nodejs,并重新构建应用程序

# conda install -c cond-forge 'nodejs>=12'
jupyter lab build

故障排除

如果扩展没有自动安装,您可以手动启用它

Jupyter Notebook 经典版

jupyter nbextension list
jupyter nbextension install --py --symlink --sys-prefix pythreejs
jupyter nbextension enable --py --sys-prefix pythreejs
jupyter nbextension list

你应该能看到

Known nbextensions:
  ...
  jupyter-js-widgets/extension  enabled
    - Validating: OK

开发者注意:在 Linux 或 MacOS 上,--symlink 参数允许直接修改 JavaScript 代码。此功能在 Windows 上不可用。

JupyterLab

要执行 源安装

## 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

你应该能看到

JupyterLab v...
  ...
    jupyterlab-datawidgets v... enabled OK
    @jupyter-widgets/jupyterlab-manager v... enabled OK
    jupyter-threejs v... enabled OK

此方法不推荐用于 JupyterLab 3,因为它启用了 联邦模块,通过 pipconda 或其他包管理器安装,并且不需要重新构建整个应用程序。

卸载

使用pip

pip uninstall pythreejs

conda

conda uninstall pythreejs

如果你执行了上述任何手动步骤,可能需要删除

Jupyter Notebook 经典版

jupyter nbextension disable --py --sys-prefix pythreejs

Jupyter Lab

jupyter labextension uninstall jupyter-threejs

开源

此软件根据 BSD-3-Clause 许可证授权。

项目详情


下载文件

下载适用于您的平台文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源分布

pythreejs-2.4.2.tar.gz (4.7 MB 查看哈希值)

上传时间

构建分布

pythreejs-2.4.2-py3-none-any.whl (3.4 MB 查看哈希值)

上传时间 Python 3

支持者:

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面