-
Hello, I am trying to connect to a mssql database with the following code: import ibis
ibis.options.interactive = True
con = ibis.connect('mssql://ipaddress') but i get this error> ImportError: Failed to import the mssql backend due to missing dependencies.
You can pip or conda install the mssql backend as follows:
python -m pip install -U "ibis-framework[mssql]" # pip install
conda install -c conda-forge ibis-mssql # or conda install I have installed the ibis-framework[mssql] through poetry add. I have tried also the example with duckdb listed in the get started page and that runs without any issues. How can i solve this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @fnagy -- The If you scroll up in the error message, you should see something about a failure to load the shared object file If you are on OSX, you should be able to |
Beta Was this translation helpful? Give feedback.
-
Hi Gil, thanks for your answer. I managed to make it work somehow, i.e. it was resulting me in a different error My connection string looks like this: con = ibis.mssql.connect(
user="xxxxx",
password="xxx",
host="xxxx", # i have also tried with specifying the port 1433
driver="{ODBC Driver 17 for SQL Server}",
# TrustServerCertificate="yes",
) I have two mssql servers: one on premise, (v. 15.0.2110.4) and one hosted and managed by azure, and the issue is present only on the former. We assume is a driver problem after having troubleshooted a bunch of config options and openssl versions. |
Beta Was this translation helpful? Give feedback.
Hey @fnagy --
The
mssql
backend usespyodbc
which requires installing an ODBC driver separately if you install using a Python-only package manager (i.e. something that isn'tconda
,mamba
,pixi
, ornix
).If you scroll up in the error message, you should see something about a failure to load the shared object file
libodbc.so.2
(or similar).If you are on OSX, you should be able to
brew install unixodbc
-- there's a similar package for Linux distributions, too. You can see thepyodbc
install wiki for more information on how to install the non-Python dependency part of this: https://github.com/mkleehammer/pyodbc/wiki/Install