[Tutor] Error while connecting to SQL Server using Python

Dennis Lee Bieber wlfraed at ix.netcom.com
Fri Jul 22 13:27:14 EDT 2022


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...).

	What is the connect string (obscure any passwords, maybe hostname, but
leave the rest). Your "error" doesn't look like a normal Python traceback,
and/or newlines have been stripped.

	Have you installed the required ODBC module? Or some other DB-API...
For example (from a stale Debian "apt search"): 

python3-pymssql/oldstable 2.1.4+dfsg-1 amd64
  Python database access for MS SQL server and Sybase - Python 3


https://docs.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-ver16
https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver16
(actual current version is 18, not 17)


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed at ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/



More information about the Tutor mailing list