cannot import name 'module_config_pb2' from 'meshtastic' #3

Closed
opened 2026-10-05 03:15:31 +02:00 by adam · 7 comments
Owner

just updated to .14 python CLI and I suspect related?

on cloning project and downloading .13 meshtastic python error seen

cannot import name 'module_config_pb2' from 'meshtastic'

just updated to .14 python CLI and I suspect related? on cloning project and downloading .13 meshtastic python error seen `cannot import name 'module_config_pb2' from 'meshtastic'` <!-- github-sync-id:2399223574 -->
adam closed this issue 2026-10-05 03:15:31 +02:00
Author
Owner

@ianmcorvidae do you know what the proper import would be now?

@ianmcorvidae do you know what the proper import would be now? <!-- github-comment-id:2218789336 -->
Author
Owner

from meshtastic.protobuf import module_config_pb2

all the protobufs moved from meshtastic to meshtastic.protobuf in 2.3.13

`from meshtastic.protobuf import module_config_pb2` all the protobufs moved from `meshtastic` to `meshtastic.protobuf` in 2.3.13 <!-- github-comment-id:2218790717 -->
Author
Owner

You can also wrap it in a try/catch like this:

try:
    from meshtastic.protobuf import module_config_pb2
except ImportError:
    from meshtastic import module_config_pb2
You can also wrap it in a try/catch like this: ```python try: from meshtastic.protobuf import module_config_pb2 except ImportError: from meshtastic import module_config_pb2 ``` <!-- github-comment-id:2218791591 -->
Author
Owner

You can also wrap it in a try/catch like this:

try:
    from meshtastic.protobuf import module_config_pb2
    from meshtastic import BROADCAST_NUM
except ImportError:
    from meshtastic import module_config_pb2, BROADCAST_NUM

settings.py also has problems with

from meshtastic import config_pb2, module_config_pb2, mesh_pb2, channel_pb2

not sure where it all is now (didnt look)

> You can also wrap it in a try/catch like this: ```python try: from meshtastic.protobuf import module_config_pb2 from meshtastic import BROADCAST_NUM except ImportError: from meshtastic import module_config_pb2, BROADCAST_NUM ``` settings.py also has problems with ```python from meshtastic import config_pb2, module_config_pb2, mesh_pb2, channel_pb2 ``` not sure where it all is now (didnt look) <!-- github-comment-id:2218855723 -->
Author
Owner

All of the _pb2 modules are now in meshtastic.protobuf as of 2.3.13, so anything that imports those should have the try/catch too, probably

All of the `_pb2` modules are now in `meshtastic.protobuf` as of 2.3.13, so anything that imports those should have the try/catch too, probably <!-- github-comment-id:2218865603 -->
Author
Owner
if handy here is a fix https://github.com/pdxlocations/meshtastic-curses-client/pull/5 <!-- github-comment-id:2218906040 -->
Author
Owner

Closed by #5

Closed by #5 <!-- github-comment-id:2219637962 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/contact#3