Registry / serialization / lcm
library1.5.2pypypi✓ verified 85d ago

lcm (Lightweight Communication and Marshalling) is a library for interprocess communication with real-time constraints, providing a low-latency publish/subscribe message passing model. Version 1.5.2 supports Python >=3.7. Release cadence is irregular, typically yearly.

pip install lcm
INSTALL
IMPORT
SIG · LCM
L
lcm
serializationpythonv1.5.2
Install
1.6s avg
Import
28ms
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.5.2 · 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
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.028s · 21.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 22MB
20MB installed
● package 20MB
Code
Verified usage

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

LCM
from lcm import LCM
import lcm
Common mistake: using 'import lcm' gives you the module object, not the class. 'from lcm import LCM' is required to access the main class.
EventLog
from lcm import EventLog

Initialize LCM, subscribe to a channel, handle incoming messages, and publish a test message.

from lcm import LCM lc = LCM() def handler(channel, data): print(f"Received on {channel}: {data}") lc.subscribe("EXAMPLE_CHANNEL", handler) lc.handle() lc.publish("EXAMPLE_CHANNEL", b"Hello, world!")
lcm-gen --version
Debug
Known issues
gotchalcm requires a running LCM daemon (lcm-logger or similar) or multicast network. Without it, publish/subscribe silently fails.
fix
Ensure LCM daemon is running or network multicast is configured. Test with lcm-spy or a simple sender/receiver.
affects: all
gotchaThe LCM class is not thread-safe. Calling methods from multiple threads can cause undefined behavior.
fix
Use locking mechanisms or ensure all LCM calls happen from a single thread.
affects: all
gotchaLCM messages are raw bytes; data serialization is left to the user. There's no built-in type marshalling beyond bytes.
fix
Use struct.pack/unpack, protobuf, or similar for structured data. Example: data = struct.pack('i', 42).
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'lcm'
lcm not installed or installed in wrong environment.
fix
Run: pip install lcm
AttributeError: module 'lcm' has no attribute 'LCM'
Imported as 'import lcm' instead of 'from lcm import LCM'.
fix
Use: from lcm import LCM
OSError: [Errno 19] No such device
LCM tries to open multicast socket but network interface doesn't support multicast or is missing.
fix
Check network configuration, or use LCM with a directed UDP address. On Linux, ensure multicast is enabled: sudo apt-get install net-tools && route -n
Upgrade
Version history
1.5.2latest on PyPI · released Oct 23, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
18
OpenAI (training)
1
Resources
lcm — pip install lcm · libregistry