close

[Solved] Can’t open lib ‘ODBC Driver 13 for SQL Server’? Sym linking issue?

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Can’t open lib ‘ODBC Driver 13 for SQL Server’? Sym linking issue? in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Can’t open lib ‘ODBC Driver 13 for SQL Server’? Sym linking issue Error Occurs?

Today I get the following error Can’t open lib ‘ODBC Driver 13 for SQL Server’? Sym linking issue? in python.

How To Solve Can’t open lib ‘ODBC Driver 13 for SQL Server’? Sym linking issue Error ?

  1. How To Solve Can't open lib 'ODBC Driver 13 for SQL Server'? Sym linking issue Error ?

    To Solve Can't open lib 'ODBC Driver 13 for SQL Server'? Sym linking issue Error In my case, I had to change the pyodbc database driver string to
    driver='{ODBC Driver 17 for SQL Server}'

  2. Can't open lib 'ODBC Driver 13 for SQL Server'? Sym linking issue?

    To Solve Can't open lib 'ODBC Driver 13 for SQL Server'? Sym linking issue Error In my case, I had to change the pyodbc database driver string to
    driver='{ODBC Driver 17 for SQL Server}'

Solution 1

Running:

odbcinst -j

It yielded:

unixODBC 2.3.4
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /Users/emehex/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

Instead of copying the files to the /etc/ directory (not sure why unixODBC thought they were there) I created a symbolic link to each file:

sudo ln -s /usr/local/etc/odbcinst.ini /etc/odbcinst.ini
sudo ln -s /usr/local/etc/odbc.ini /etc/odbc.ini

This solved the problem.

Solution 2

In my case, I had to change the pyodbc database driver string to
driver='{ODBC Driver 17 for SQL Server}'

actually, in my python code pyodbc was expecting ODBC Driver 13 but, as the ODBC Driver version was updated (because of ubuntu update) to current version ODBC Driver 17, the problem had occurred.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read