Registry / ai-ml / viser
library1.1.0pypypi✓ verified 23d ago

Viser is a Python library designed for interactive 3D visualization, primarily targeting applications in computer vision and robotics. It provides a rich API for visualizing 3D primitives and constructing interactive GUI elements, all delivered through a responsive, web-based client that enables easy use over SSH and in Jupyter notebooks. The library is actively maintained with frequent releases, currently at version 1.0.26.

pip install viser
INSTALL
IMPORT
SIG · VISER
V
viser
ai-mlpythonv1.1.0
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
1/2 runs
1/2 runs
py 3.11
1/2 runs
1/2 runs
py 3.12
1/2 runs
1/2 runs
py 3.13
1/2 runs
1/2 runs
py 3.9
1/2 runs
1/2 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ViserServer
from viser import ViserServer
This is the main class for instantiating the visualization server.

This quickstart code initializes a Viser server, adds a red sphere to the 3D scene, and includes a GUI slider to interactively control the sphere's X-axis position. Access the visualization by navigating to the printed URL in your web browser.

import time import numpy as np from viser import ViserServer # Create a Viser server server = ViserServer(port=8080, label='My Viser App') print(f"Viser server started at: http://localhost:{server.get_port()}") # Add a red sphere to the scene server.scene.add_sphere( name="/my_sphere", position=(0.0, 0.0, 0.0), radius=0.5, color=(1.0, 0.0, 0.0) ) # Add a simple GUI slider to control sphere's X position x_position_slider = server.gui.add_slider( name="Sphere X Position", min=-2.0, max=2.0, step=0.1, initial_value=0.0 ) @x_position_slider.on_update def _(field): current_position = list(server.scene["/my_sphere"].position) current_position[0] = field.value server.scene["/my_sphere"].position = tuple(current_position) # Keep the server running indefinitely server.sleep_forever()
Debug
Known issues
breakingWhen updating properties of `SceneNodeHandles` (e.g., position, orientation), explicit reassignment of the entire property is required, especially when modifying NumPy arrays in-place. Direct in-place modification of array elements might not trigger updates to the client for versions `0.2.10` and later.
fix
Instead of `handle.position[0] += 0.1`, use `new_pos = list(handle.position); new_pos[0] += 0.1; handle.position = tuple(new_pos)` (or similar explicit reassignment with `numpy` arrays).
affects: >=0.2.10
gotchaViser enforces strict version compatibility between the Python backend and the web client. If the client (served by the browser) and the Python server versions do not match, the connection will be rejected with a protocol error (code 1002). This is a security and stability feature to prevent mismatched functionality.
fix
Ensure that your `viser` Python package version matches the client version it attempts to serve. If manually hosting a client, ensure it's built from a compatible `viser` source.
affects: All versions
gotchaOn some Windows systems, users have reported issues where the Viser web client fails to load due to a 'Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain"' error. This is often caused by missing or incorrect `.js` MIME type definitions in the Windows registry.
fix
This is an environment-specific issue. Potential workarounds include ensuring the Windows registry correctly associates `.js` files with `text/javascript` MIME type, or trying different web browsers.
affects: Potentially all versions on affected Windows environments
gotchaViser's API is inherently stateful, and all data transfers between the Python server and the web client occur over a WebSocket connection. This can introduce network overhead, especially for frequent, high-bandwidth updates or complex user interactions requiring round-trip communication. Static web page exports with full interactivity are not directly supported.
fix
Optimize your data updates to minimize frequency and size where possible. For purely static scene exports without interactivity, consider using `server.get_scene_serializer().serialize()` to save the scene state to a `.viser` file.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'viser'
The 'viser' Python package is not installed in your current environment.
fix
Run `pip install viser` in your terminal to install the library.
OSError: [Errno 98] Address already in use
The default port (commonly 8080 or 8081) that viser attempts to use is already occupied by another process.
fix
Start the viser server on a different, available port, for example: `server = viser.ViserServer(port=8082)`.
viser.transforms.SE3 is deprecated, please use viser.transforms.SRT3 instead.
The `viser.transforms.SE3` class has been deprecated in a newer version of the library and should be replaced with `viser.transforms.SRT3`.
fix
Update your code to use `viser.transforms.SRT3` where `viser.transforms.SE3` was previously used.
TypeError: 'colors' must be a (N, 3) or (N, 4) array of floats in [0,1]
The color data provided for a visualization primitive (e.g., `add_point_cloud`) does not conform to the expected NumPy array shape, data type (float), or value range ([0,1]).
fix
Convert the color array to a NumPy array of floats with values between 0 and 1, shaped `(N, 3)` or `(N, 4)`, for example: `colors=my_rgb_array.astype(np.float32) / 255.0` (if `my_rgb_array` contains 0-255 integers).
Upgrade
Version history
1.1.0latest on PyPI · released Aug 16, 2026
Audit
Dependencies
pythonrequiredRequired Python version.
Agent activity
35 hits · last 30 days
node
30
OpenAI (training)
1
Resources
viser — pip install viser · libregistry