napari is an n-dimensional array viewer in Python, providing an interactive, multi-dimensional data viewer for scientific visualization. It emphasizes image processing and analysis, offering a flexible, plugin-friendly architecture. As of version 0.7.0, it continues active development with regular feature additions and improvements to its core architecture and ecosystem.
pip install napari[all]Verified import paths — ran on the pinned version, not inferred.
This quickstart initializes a napari viewer, adds a simple 2D image layer generated with NumPy, and ensures the viewer's event loop is started using `napari.run()` for a responsive GUI. Replace `np.random.rand` with your actual image data.
Ensure you have a Qt backend installed: `pip install napari[all]` or `pip install napari[pyside6]` for a specific backend.
Instead of `viewer = napari.Viewer(title='My Viewer')`, use `viewer = napari.Viewer(); viewer.window.title = 'My Viewer'`.
Always include `if __name__ == '__main__': napari.run()` at the end of your script when running napari directly.
Update calls from `napari.app.run()` to `napari.run()`.
Replace `viewer.add_layer(napari.layers.Image(data))` with `viewer.add_image(data)`.