[Python] Paho MQTT "Unsupported callback API version" error

Discussão em 'Python' iniciado por Stack, Maio 20, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to implement Paho Python MQTT and connect to an online broker but the code seems to through an error.


    ValueError: Unsupported callback API version: version 2.0 added a callback_api_version, see migrations.md for details
    ​

    I was trying to implement a simple paho client example from the given website; the following will reproduce the issue:

    from paho.mqtt import client as mqtt_client
    import random

    broker = 'broker.emqx.io'
    port = 1883
    topic = "python/mqtt"
    client_id = f'python-mqtt-{random.randint(0, 1000)}'
    client = mqtt_client.Client(client_id)

    Continue reading...

Compartilhe esta Página