TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

python udf load failed

Open chessplay opened this issue 1 year ago • 5 comments

基础环境anaconda python3.8/源码编译的python3.8,cmake3.26.4,gcc10.2,用pip3 install taospyudf安装成功,在/usr/local/lib下已经有了动态链接库taospyudf.so,但是创建函数后执行还是出现动态链接库无法加载,采用官方例子 在/root/udf/目录下建立myfun.py文件,内容如下 def init(): pass

def destroy(): pass

def process(block): rows, _ = block.shape() return [block.data(i, 0) ** 2 + 1 for i in range(rows)]

并使用命令行创建函数成功:create function myfun as '/root/udf/myfun.py' outputtype double language 'Python'; 但是执行查询出现udf执行失败 image

查看/var/log/taos/udfdlog.0 发现 img_v3_02a8_e02c71f6-6209-4107-b75d-ec4f04152edg

已经执行过ldconfig刷新动态链接库缓存,并且把/usr/local/lib添加到LD_LIBRARY_PATH,也尝试过在taos.cfg里面把python库的相关路径加到配置中,并且把libtaospyudf.so权限设置成777,都同样出现这个动态链接库没加载到 image

chessplay avatar Apr 19 '24 02:04 chessplay

收到我们看下

yu285 avatar Apr 24 '24 02:04 yu285

image

yu285 avatar Apr 29 '24 09:04 yu285

请参考一下

yu285 avatar Apr 29 '24 09:04 yu285

我用这个库按照后在/usr/local/lib目录里,用ldd看了下,好像没有关联python的动态链接库,会不会是这个问题,如果是因为这个问题,要怎么解决,我是源码编译python,然后用pip3 install taospyudf这个库来生成的image

chessplay avatar Apr 29 '24 09:04 chessplay

https://mp.weixin.qq.com/s/qsewb_pqNhbv8rqjm4ysJw

看看这个是否有帮助

yu285 avatar May 09 '24 01:05 yu285