Access MS SQL server on a mac via pyodbc with openssl3.0 installed

Matt Dufty 0 Reputation points
2025-02-27T08:59:22.24+00:00

I have installed unixodbc, pyodbc and openssl3.0 on my back

import pyodbc

SERVER = 'SERVER'

DATABASE = 'DB'

USERNAME = 'USER'

PASSWORD = "xxxxxxxxx"

DRIVER = '/opt/homebrew/Cellar/msodbcsql18/18.4.1.1/lib/libmsodbcsql.18.dylib'

connection_string = f'DRIVER={DRIVER};SERVER={SERVER};DATABASE={DATABASE};UID={USERNAME};PWD={PASSWORD};'

conn = pyodbc.connect(connection_string)

OperationalError: ('08001', '[08001] [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [OpenSSL library could not be loaded, make sure OpenSSL 1.0, 1.1, or 3.0 is installed] (-1) (SQLDriverConnect)')



Running openssl version on the terminal yields:

OpenSSL 3.0.16 11 Feb 2025 (Library: OpenSSL 3.0.16 11 Feb 2025)

I can't find anything on the web to solve this.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
42,354 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.