[Driver Manager]Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.7.so.2.1'

Emilio C 1 Reputation point

Thanks in advance for the help .

Ubuntu system.
Python 3.7
Installed pyodbc.
Installed Microsoft ODBC Driver for SQL Server (Linux Ubuntiu

Azure SQL Paas Service

I am trying to connect using pyodbc. The connection string I am using is:

DRIVER={ODBC Driver 17 for SQL Server}; Server=XX; Database=XX; UID=XX; PWD=XX;

The error I get back is:

Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.7.so.2.1' : file not found (0) (SQLDriverConnect)")

I have tried uninstalling and reinstalling the driver several times but no luck. Everything remains the same. May be I need to make a clean removing and install again but i can't find clear instructions for a good uninstallation. . In fact i can't find /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.7.so.2.1

odbcinst -j

unixODBC 2.3.9
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES...: /etc/ODBCDataSources
USER DATA SOURCES...: /home/emilio/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8

cat /etc/odbcinst.ini

ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server

Any help?

Thank you.

Translated with www.DeepL.com/Translator (free version)

Azure SQL Database
{count} votes