Skip to content

Pylance complains about "CallbackAPIVersion" is not exported from module "paho.mqtt.client" #892

@MichielfromNL

Description

@MichielfromNL

Minor inconvenience yet probably good to report:

This code runs fine, but Pylance with standard type checking complains about the Callback definitions.

Code:
mqttc = mqtt.Client(callback_api_version = mqtt.CallbackAPIVersion.VERSION2, client_id = 'Palert',protocol = mqtt.MQTTv5)
Results in pylance error:
"CallbackAPIVersion" is not exported from module "paho.mqtt.client"

Leave out the mqtt.:
mqttc = mqtt.Client(callback_api_version = CallbackAPIVersion.VERSION2, client_id = 'Palert',protocol = mqtt.MQTTv5)
error = "CallbackAPIVersion" is not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: AvailableNo one has claimed responsibility for resolving this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions