Skip to content

python安装问题 #193

@Eduardo95

Description

@Eduardo95
No description provided.

Activity

changed the title [-]python[/-] [+]python安装问题[/+] on Jul 26, 2019
Eduardo95

Eduardo95 commented on Jul 26, 2019

@Eduardo95
Author

我按照github上的步骤源码安装了tdengine,然后使用官网上的教程安装了python包,但是import的时候报错

import taos
Traceback (most recent call last):
File "", line 1, in
File "/df-test/TDengine/src/connector/python/python3/taos/init.py", line 2, in
from .connection import TDengineConnection
File "/df-test/TDengine/src/connector/python/python3/taos/connection.py", line 2, in
from .cursor import TDengineCursor
File "/df-test/TDengine/src/connector/python/python3/taos/cursor.py", line 1, in
from .cinterface import CTaosInterface
File "/df-test/TDengine/src/connector/python/python3/taos/cinterface.py", line 137, in
class CTaosInterface(object):
File "/df-test/TDengine/src/connector/python/python3/taos/cinterface.py", line 139, in CTaosInterface
libtaos = ctypes.CDLL('libtaos.so')
File "/root/anaconda3/lib/python3.7/ctypes/init.py", line 356, in init
self._handle = _dlopen(self._name, mode)
OSError: libtaos.so: cannot open shared object file: No such file or directory

请问这是什么问题

Eduardo95

Eduardo95 commented on Jul 26, 2019

@Eduardo95
Author

已解决

byronsong

byronsong commented on Aug 7, 2019

@byronsong

请问你是怎么解决的?
我是64位centOS
执行命令:cp /usr/lib/libtaos.so /usr/lib64/
后OK了。

那么tdengine官方安装程序,是不是应该判断是32位系统,还是64位系统,然后将类库文件安装到正确路径。而不是需要每个人都手工纠正一遍?

hzcheng

hzcheng commented on Aug 7, 2019

@hzcheng
Contributor

centos系统下貌似不会将/usr/lib文件夹放到C的动态链接列表里。可以通过在
~/.bash_profile文件中加上:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib"

然后

source ~/.bash_profile
byronsong

byronsong commented on Aug 7, 2019

@byronsong

嗯。想起来了。
是通过pip安装的libtaos
那么或者应该可以在pip命令中指定target dir,安装到指定目录中。

Python没有认真学。就直接用了。
见笑了。

treemp3

treemp3 commented on Aug 22, 2019

@treemp3

CentOS7.6 minimal版本pip3安装python3客户端后,需要执行cp /usr/lib/libtaos.so /usr/lib64/
不然会报错:OSError: libtaos.so: cannot open shared object file: No such file or directory
官方可以写到faq里面,方便大家查询。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @byronsong@Eduardo95@treemp3@hzcheng

        Issue actions

          python安装问题 · Issue #193 · taosdata/TDengine