Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python udf load failed #25406

Closed
chessplay opened this issue Apr 19, 2024 · 5 comments
Closed

python udf load failed #25406

chessplay opened this issue Apr 19, 2024 · 5 comments
Assignees
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@chessplay
Copy link

chessplay commented Apr 19, 2024

基础环境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 chessplay added help wanted Extra attention is needed question Further information is requested labels Apr 19, 2024
@yu285 yu285 changed the title python udf加载失败 python udf load failed Apr 24, 2024
@yu285 yu285 self-assigned this Apr 24, 2024
@yu285
Copy link
Contributor

yu285 commented Apr 24, 2024

收到我们看下

@yu285
Copy link
Contributor

yu285 commented Apr 29, 2024

image

@yu285
Copy link
Contributor

yu285 commented Apr 29, 2024

请参考一下

@chessplay
Copy link
Author

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

@yu285
Copy link
Contributor

yu285 commented May 9, 2024

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

看看这个是否有帮助

@yu285 yu285 closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants