首页
/ scipy2017-jupyter-widgets-tutorial 的安装和配置教程

scipy2017-jupyter-widgets-tutorial 的安装和配置教程

2025-05-29 02:07:47作者:胡易黎Nicole

1. 项目基础介绍和主要编程语言

scipy2017-jupyter-widgets-tutorial 是一个开源项目,旨在为SciPy 2017教程提供关于Jupyter交互式小部件生态系统的教学笔记。该项目主要使用Jupyter Notebook作为编程环境,以Python作为主要的编程语言。

2. 项目使用的关键技术和框架

本项目使用的关键技术包括:

  • Jupyter Notebook: 一个开源的Web应用程序,允许你创建和共享包含实时代码、方程、可视化和文本的文档。
  • ipywidgets: 一个Jupyter Notebook的交互式小部件库,用于创建交互式的UI控件。
  • bqplot: 一个基于ipywidgets的交互式可视化库。
  • ipyvolume: 用于3D体积可视化的Jupyter小部件。
  • ipyleaflet: 用于在Jupyter笔记本中创建交互式地图的库。
  • pythreejs: Three.js的Python绑定,用于在Jupyter笔记本中创建3D图形。

3. 项目安装和配置的准备工作及详细步骤

准备工作

在开始安装之前,请确保您的系统中已经安装了Python。本项目推荐使用Anaconda Python发行版,因为它包含了创建独立环境所需的所有工具。

安装步骤

使用Anaconda安装

  1. 创建一个新的Anaconda环境:

    conda create -n widgets-tutorial -c conda-forge python=3.6 pip notebook=5.5 numpy scikit-image scipy pandas=0.23 requests
    
  2. 激活新创建的环境:

    conda activate widgets-tutorial
    
  3. 安装ipywidgets和相关依赖:

    conda install -c conda-forge ipywidgets=7.2 bqplot ipyvolume ipyleaflet pythreejs ipyevents
    
  4. 安装pywwt从另一个渠道:

    conda install -c wwt pywwt
    
  5. 为此环境创建一个新的ipython内核:

    ipython kernel install --name widgets-tutorial --display-name widgets-tutorial --sys-prefix
    
  6. 如果您打算使用JupyterLab,请安装JupyterLab和相关的扩展:

    conda install -c conda-forge jupyterlab nodejs=9.11
    jupyter labextension install @jupyter-widgets/jupyterlab-manager bqplot ipyvolume jupyter-threejs jupyter-leaflet
    

使用pip安装

如果您不使用Anaconda Python发行版,可以使用以下pip命令进行安装:

pip install notebook==5.5 ipywidgets numpy scipy scikit-image traitlets requests bqplot ipywidgets==7.2 ipyvolume matplotlib pandas==0.23 ipyleaflet pythreejs ipyevents pywwt

如果使用JupyterLab,还需要安装:

pip install jupyterlab

以及运行以下命令安装JupyterLab扩展:

jupyter labextension install @jupyter-widgets/jupyterlab-manager bqplot ipyvolume jupyter-threejs jupyter-leaflet

验证安装

要验证安装是否成功,请下载install_check.py脚本并运行:

python install_check.py

以上就是scipy2017-jupyter-widgets-tutorial的详细安装和配置指南。按照这些步骤操作,您应该能够成功安装并开始使用该项目。

登录后查看全文
热门项目推荐