简体   繁体   中英

Use Data Subscription through python in TDengine

I'm trying data subscription feature of TDengine.

I tested its Python demo .

from taos.tmq import TaosConsumer

# Syntax: `consumer = TaosConsumer(*topics, **args)`
#
# Example:
consumer = TaosConsumer('topic1', 'topic2', td_connect_ip = "127.0.0.1", group_id = "local")

...

When executing the script, there is an error information:

ImportError: cannot import name 'TaosConsumer'

Did I miss some steps?

I think you need to update the version of taospy on your system - taospy is the TDengine connector for Python.

Try running pip install -U taospy to update it and then do your test again.

Make sure you're running Python 3.7 or later.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM