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
driver not found, Pyodbc.drivers=[]: pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)") #1054
Comments
Have you actually installed the driver? Can you check if connecting using Also, note that PORT is not a valid connection string keyword. Where did you get that from? The full list of valid keywords is here: https://docs.microsoft.com/en-us/sql/connect/odbc/dsn-connection-string-attribute |
I installed the drivers with brew.
After not being successfull, I followed the instructions on https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-Mac-OSX
returns
returns |
To formulate my issue more clear: Running
outputs
Using the same connection string in isql:
returns |
Are you using an x86 Python (and pyODBC) ? Check with |
it's 3.9.7, /Users/deniz/Anaconda/anaconda3/bin/python. how do I find out if it's x86 or not? |
|
I ran into this problem the other day. What I found was the microsoft sql driver version with the current install defaults load is for version 18, not 17 when I changed the SQL driver designation in the pyodbc connect call to 18. this error went away and my connection was made. |
I am getting the same 'file not found' error for both the MS SQL driver AND the FreeTDS driver on my M1 Mac, Monterey 12.4: Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/homebrew/Cellar/freetds/1.3.12/lib/libtdsodbc.so' : file not found (0) (SQLDriverConnect)") Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/homebrew/lib/libmsodbcsql.18.dylib' : file not found (0) (SQLDriverConnect)") No matter how I build out my odbcinst.ini file, reinstall unixodbc, or pyodbc, etc., I can't get pyodbc to work. Jumping to something like pymssql won't work for me due to the lack of generic INSERT terms (? vs. %s), so I'm stuck here. Python 3.9.7, pyodbc 4.0.3 Any thoughts? EDIT: [ODBC Driver 18 for SQL Server] [FreeTDS] [ODBC Driver 17 for SQL Server] |
Have it on Gentoo as well with Python 3.9.12 and PyODBC 4.0.34 with DB2 as well MariaDB. In connection string with:
its working. If i write
while having
in /etc/unixODBC/odbcinst.ini resulting into
In older version of python & pyodbc combination it worked with the exact same configuration and code. Unfortunately for DB2 i can't pass the driver directly, as it would return in too long connection string for the DB2 driver :( |
4.0.34 is flawed. See #1082 |
Is it really solved? |
I am still facing same issue even though i have drivers already installed in the system. |
Did you check the pyODBC version as mentioned above? |
@v-chojas |
Environment
Issue
When running
I get
output:
How can I fix this?
The text was updated successfully, but these errors were encountered: