{"id":4843,"library":"viser","title":"viser: 3D Visualization for Computer Vision and Robotics","description":"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.","status":"active","version":"1.0.26","language":"python","source_language":"en","source_url":"https://github.com/viser-project/viser","tags":["3d","visualization","robotics","computer-vision","web-ui","realtime","gui"],"install":[{"cmd":"pip install viser","lang":"bash","label":"Install core library"},{"cmd":"pip install \"viser[examples]\"","lang":"bash","label":"Install with example dependencies"}],"dependencies":[{"reason":"Required Python version.","package":"python","optional":false}],"imports":[{"note":"This is the main class for instantiating the visualization server.","symbol":"ViserServer","correct":"from viser import ViserServer"}],"quickstart":{"code":"import time\nimport numpy as np\nfrom viser import ViserServer\n\n# Create a Viser server\nserver = ViserServer(port=8080, label='My Viser App')\nprint(f\"Viser server started at: http://localhost:{server.get_port()}\")\n\n# Add a red sphere to the scene\nserver.scene.add_sphere(\n    name=\"/my_sphere\",\n    position=(0.0, 0.0, 0.0),\n    radius=0.5,\n    color=(1.0, 0.0, 0.0)\n)\n\n# Add a simple GUI slider to control sphere's X position\nx_position_slider = server.gui.add_slider(\n    name=\"Sphere X Position\",\n    min=-2.0,\n    max=2.0,\n    step=0.1,\n    initial_value=0.0\n)\n\n@x_position_slider.on_update\ndef _(field):\n    current_position = list(server.scene[\"/my_sphere\"].position)\n    current_position[0] = field.value\n    server.scene[\"/my_sphere\"].position = tuple(current_position)\n\n# Keep the server running indefinitely\nserver.sleep_forever()","lang":"python","description":"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."},"warnings":[{"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).","message":"When 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.","severity":"breaking","affected_versions":">=0.2.10"},{"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.","message":"Viser 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"On 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.","severity":"gotcha","affected_versions":"Potentially all versions on affected Windows environments"},{"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.","message":"Viser'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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'1.0.26':71 '3d':2,17,34,72 'activ':63 'api':31 'applic':21 'base':48 'client':49 'comput':5,23,76 'computer-vis':75 'construct':37 'current':68 'deliv':42 'design':14 'easi':52 'element':40 'enabl':51 'frequent':66 'gui':39,82 'interact':16,38 'jupyt':58 'librari':13,61 'maintain':64 'notebook':59 'primarili':19 'primit':35 'provid':28 'python':12 'realtim':81 'releas':67 'respons':45 'rich':30 'robot':8,26,74 'ssh':55 'target':20 'ui':80 'use':53 'version':70 'viser':1,9 'vision':6,24,77 'visual':3,18,33,73 'web':47,79 'web-bas':46 'web-ui':78","created_at":"2026-04-12T14:09:58.462109+00:00","updated_at":"2026-04-17T00:17:15.200586+00:00","problems":[{"fix":"Run `pip install viser` in your terminal to install the library.","cause":"The 'viser' Python package is not installed in your current environment.","error":"ModuleNotFoundError: No module named 'viser'"},{"fix":"Start the viser server on a different, available port, for example: `server = viser.ViserServer(port=8082)`.","cause":"The default port (commonly 8080 or 8081) that viser attempts to use is already occupied by another process.","error":"OSError: [Errno 98] Address already in use"},{"fix":"Update your code to use `viser.transforms.SRT3` where `viser.transforms.SE3` was previously used.","cause":"The `viser.transforms.SE3` class has been deprecated in a newer version of the library and should be replaced with `viser.transforms.SRT3`.","error":"viser.transforms.SE3 is deprecated, please use viser.transforms.SRT3 instead."},{"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).","cause":"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]).","error":"TypeError: 'colors' must be a (N, 3) or (N, 4) array of floats in [0,1]"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.1.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/viser-project/viser","docs":null,"changelog":null,"pypi":"https://pypi.org/project/viser/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}