superduper icon indicating copy to clipboard operation
superduper copied to clipboard

[BUG]: Error initializing to DataBackend Client: module 'ibis' has no attribute 'connect'

Open TaoPeiLing opened this issue 1 year ago • 3 comments

Contact Details [Optional]

taopl

System Information

通过 pip指令安装superduperdb之后使用下列编码运行: from superduperdb import superduper from superduperdb.backends.ibis.query import RawSQL from superduperdb.ext.openai import OpenAIChatCompletion db = superduper( "mysql://root:[email protected]:3306/zlzjjg_bank", metadata_store='mysql://root:[email protected]:3306/zlzjjg_bank', ) if name == "main": # chat_with_mysql("students","查询名字叫周七的人信息") db.show('vector_index') 运行出现 2024-Feb-02 15:10:23.13| DEBUG | taopl | 292b3876-cd6e-407a-89c5-c761cdf7a5d7| superduperdb.base.build:50 | Parsing data connection URI:mysql://root:[email protected]:3306/zlzjjg_bank 2024-Feb-02 15:10:23.13| ERROR | taopl | 292b3876-cd6e-407a-89c5-c761cdf7a5d7| superduperdb.base.build:140 | Error initializing to DataBackend Client: module 'ibis' has no attribute 'connect'的错误。 我检查了对应的安装包,如下: ibis3 我的python版本是Python 3.11.7

What happened?

我希望可以连接上我的数据库

Steps to reproduce

...

Relevant log output

No response

TaoPeiLing avatar Feb 02 '24 07:02 TaoPeiLing

"After installing superduperdb via the pip command, run the following code:

from superduperdb import superduper
from superduperdb.backends.ibis.query import RawSQL
from superduperdb.ext.openai import OpenAIChatCompletion
db = superduper(
"mysql://root:[email protected]:3306/zlzjjg_bank",
metadata_store='mysql://root:[email protected]:3306/zlzjjg_bank',
)
if __name__ == "__main__":
    # chat_with_mysql("students","Query information about a person named Zhou Qi")
    db.show('vector_index')

Running it, the following error occurred on 2024-Feb-02 15:10:23.13| DEBUG | taopl | 292b3876-cd6e-407a-89c5-c761cdf7a5d7| superduperdb.base.build:50 | Parsing data connection URI:mysql://root:[email protected]:3306/zlzjjg_bank 2024-Feb-02 15:10:23.13| ERROR | taopl | 292b3876-cd6e-407a-89c5-c761cdf7a5d7| superduperdb.base.build:140 | Error initializing to DataBackend Client: module 'ibis' has no attribute 'connect'. I checked the corresponding packages as follows:"

blythed avatar Feb 02 '24 12:02 blythed

I had similar issues with MS SQL. I uninstalled both ibis and ibis-framework[mssql] and installed only ibis-framework[mssql] and it worked as expected.

from superduperdb import superduper
import ibis
connection_uri = "mssql://sa:pass@localhost:1433/mydb"
db = superduper(connection_uri) 
db.show('vector_index')

Here is the output. D:\superduberdb> d: && cd d:\superduberdb && cmd /C "C:\Python310\python.exe c:\Users\Murali\.vscode\extensions\ms-python.python-2023.20.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher 55316 -- D:\superduberdb\sql.py " C:\Python310\lib\site-packages\ibis\backends\mssql\__init__.py:59: SAWarning: No driver name specified; this is expected by PyODBC when using DSN-less connections engine = sa.create_engine( 2024-Feb-25 21:03:02.92| INFO | DESKTOP-6MNN06A| 9155e869-1864-47a6-b1cf-f7688f9ffa63| superduperdb.base.build:61 | Data Client is ready. <ibis.backends.mssql.Backend object at 0x00000268E5AA4D00> 2024-Feb-25 21:03:02.94| INFO | DESKTOP-6MNN06A| 9155e869-1864-47a6-b1cf-f7688f9ffa63| superduperdb.base.build:36 | Connecting to Metadata Client with engine: <ibis.backends.mssql.Backend object at 0x00000268E5AA4D00> 2024-Feb-25 21:03:03.08| INFO | DESKTOP-6MNN06A| 9155e869-1864-47a6-b1cf-f7688f9ffa63| superduperdb.base.build:144 | Connecting to compute client: local 2024-Feb-25 21:03:03.08| INFO | DESKTOP-6MNN06A| 9155e869-1864-47a6-b1cf-f7688f9ffa63| superduperdb.base.datalayer:80 | Building Data Layer

muralidharand avatar Feb 25 '24 15:02 muralidharand

Ibis dev here.

This ibis and ibis-framework packages cannot be installed together. They are unrelated to each other and they import with the same name.

The fix is to remove this line: https://github.com/SuperDuperDB/superduperdb/blob/main/pyproject.toml#L61

cpcloud avatar Apr 05 '24 14:04 cpcloud