[Tutor] Error while connecting to SQL Server using Python

Sachit Murarka connectsachit at gmail.com
Fri Jul 22 14:08:34 EDT 2022


Hi Mats/Dennis,

Following is the output.

 $cat /etc/odbcinst.ini
[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.1.1
UsageCount=1

We are using Ubuntu and we have installed odbc driver as well.

Have referred following documentation:-

https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver16#ubuntu17


Kind Regards,
Sachit Murarka


On Fri, Jul 22, 2022 at 11:04 PM Mats Wichmann <mats at wichmann.us> wrote:

> On 7/22/22 11:27, Dennis Lee Bieber wrote:
> > On Fri, 22 Jul 2022 20:06:24 +0530, Sachit Murarka
> > <connectsachit at gmail.com> declaimed the following:
> >
> >> Facing below error while using pyodbc to connect to SQL Server.
> >>
> >> conn = pyodbc.connect( pyodbc.Error: ('01000', "[01000]
> [unixODBC][Driver
> >> Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found
> (0)
> >> (SQLDriverConnect)")
> >>
> >> Can anyone pls suggest what could be done?
> >>
> >
> >       What OS? (the "unixODBC" suggests it may be some variant of Linux,
> > but...).
>
> If it *is* Linux, check that the driver you're trying to use is listed
> in /etc/odbcinst.ini.  There are a bunch of defaults there, but I think
> the Microsoft ODBC drivers, of which there about two zillion different
> versions, are not among them.
>
> There should be documentation on that topic, if that is indeed the issue.
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>


More information about the Tutor mailing list