{"id":45907,"library":"pyros-genmsg","title":"pyros-genmsg","description":"Standalone Python library for generating ROS message and service data structures for various languages. Current version 0.5.8, release cadence is sporadic.","status":"active","version":"0.5.8","language":"python","source_language":"en","source_url":"https://github.com/ros/genmsg","tags":["ros","message-generator","python"],"install":[{"cmd":"pip install pyros-genmsg","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The package provides the 'genmsg' module, not 'pyros_genmsg' or similar.","symbol":"genmsg","correct":"import genmsg"}],"quickstart":{"code":"import genmsg\nfrom genmsg import MsgSpec, FieldSpec\n# Generate a simple message spec\nmsg_spec = MsgSpec(types=['int32'], names=['x'], text='int32 x', full_name='test/Point2D')\nprint(msg_spec)","lang":"python","description":"Import genmsg and use MsgSpec/FieldSpec to define message structures."},"warnings":[{"fix":"Use 'ros2' packages or 'genmsg' from ROS 2 distro.","message":"This library does NOT include ROS 2 support (pyros-genmsg is for ROS 1 genmsg replacement). Do not use with ROS 2.","severity":"gotcha","affected_versions":"all"},{"fix":"Use keyword arguments: MsgSpec(types=[...], names=[...], text=\"...\", full_name=\"...\").","message":"MsgSpec initialization signature changed in recent versions. Older examples may use positional args differently.","severity":"deprecated","affected_versions":">=0.4"},{"fix":"Set os.environ['ROS_PACKAGE_PATH'] to the directory containing your .msg files before calling generation functions.","message":"The library expects ROS package paths to be set via environment variable ROS_PACKAGE_PATH, which may not be available in standalone scripts.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.5.8':20 'cadenc':22 'current':18 'data':13 'generat':8,28 'genmsg':3 'languag':17 'librari':6 'messag':10,27 'message-gener':26 'pyro':2 'pyros-genmsg':1 'python':5,29 'releas':21 'ros':9,25 'servic':12 'sporad':24 'standalon':4 'structur':14 'various':16 'version':19","created_at":"2026-06-07T12:57:19.072947+00:00","updated_at":"2026-06-07T12:57:19.072947+00:00","problems":[{"fix":"pip install pyros-genmsg; then import genmsg.","cause":"The package is installed as pyros-genmsg but import uses 'genmsg'.","error":"ModuleNotFoundError: No module named 'genmsg'"},{"fix":"Upgrade pyros-genmsg to latest: pip install --upgrade pyros-genmsg.","cause":"Very old version of genmsg (pre-0.4) where MsgSpec was named differently or not exposed.","error":"AttributeError: module 'genmsg' has no attribute 'MsgSpec'"},{"fix":"Ensure text uses ROS format: 'type name' per line, e.g., 'int32 x'.","cause":"Provided msg text does not follow ROS msg format (e.g., missing type/name pair).","error":"ValueError: Invalid msg specification: 'int32 x'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/ros/genmsg","github":"https://github.com/ros/genmsg","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}