Skip to content

Installation

Requirements

Requirements

Supported Python Versions is required. Python versions outside this range may work, but their usage is not supported, and at least some features are >Python 3.12.

Python packages

  • numpy - required for core routines
  • numba - required for core routines (and most of the speed)
  • h5py - required for reading snapshot data and saving Cubes and PackedTrees
  • xxhash - required for core routines (packed metadata format)

Optional packages

Visualization (the viz group):

  • matplotlib - to use basic octree visualization and plotting (see Finding Particles Within a Shape or Basic_Usage in the Examples)
  • pygfx - to do interactive octree visualization (see Example_PackedTree in the Examples)
  • rendercanvas - to do interactive octree visualization
  • pyside6 - performant interactive octree visualization (uses Qt, other options include wgpu-py, pyodide. See the rendercanvas backends documentation for more details

Jupyter (the jupyter group):

  • jupyter-rfb - for interactive octree visualization in a notebook (see the Visualization section, above)

The all group combines both of the above.

Basic Usage

Installation

Installation is easy

We're on PyPI:

pip install packingcubes
uv pip install packingcubes
pixi add packingcubes --pypi

Additional package requirements can be installed via optional dependencies (see Optional Packages). Example:

pip install "packingcubes[viz, jupyter]"
uv pip install packingcubes --extra viz --extra jupyter
pixi add packingcubes[viz, jupyter] --pypi