Python 3.11.7 import taos就报错 win环境
代码 conn = taos.connect( host="127.0.0.1", user="root", password="taosdata", port=6030, )
db = "power"
conn.execute(f"DROP DATABASE IF EXISTS {db}") conn.execute(f"CREATE DATABASE {db}")
change database. same as execute "USE db"
conn.select_db(db)
create super table
conn.execute(
"CREATE TABLE meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupid INT, location BINARY(16))"
)
create table
conn.execute("CREATE TABLE d0 USING meters TAGS(0, 'Los Angles')")
conn.close()
exit()
报错
unable to load taos client library: Could not find module 'taos' (or one of its dependencies). Try using the full path with constructor syntax. Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\taos\cinterface.py", line 51, in load_taos_windows return ctypes.windll.LoadLibrary("taos") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\ctypes_init.py", line 454, in LoadLibrary return self.dlltype(name) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\ctypes_init.py", line 376, in init self._handle = _dlopen(self._name, mode) ^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: Could not find module 'taos' (or one of its dependencies). Try using the full path with constructor syntax.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\taos\cinterface.py", line 57, in load_taos_windows ctypes.windll.LoadLibrary(find_library("taos")) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\ctypes_init.py", line 454, in LoadLibrary return self._dlltype(name) ^^^^^^^^^^^^^^^^^^^ if '/' in name or '\' in name: ^^^^^^^^^^^ TypeError: argument of type 'NoneType' is not iterable
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\taos\cinterface.py", line 72, in _load_taos return load_funcpf ^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\taos\cinterface.py", line 59, in _load_taos_windows raise InterfaceError("unable to load taos client library: %s" % final_err) taos.error.InterfaceError: [0xffff]: unable to load taos client library: argument of type 'NoneType' is not iterable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "