Skip to content

Instantly share code, notes, and snippets.

@dataders
Created March 16, 2023 18:11
Show Gist options
  • Save dataders/e36cac9b7bcd21e06a807335d9cd0b3a to your computer and use it in GitHub Desktop.
Save dataders/e36cac9b7bcd21e06a807335d9cd0b3a to your computer and use it in GitHub Desktop.
brain dump on working with dbt, MSODBC driver on an M1 macbook

Setup dbt-sqlserver / dbt-synapse on M1

Install pyodbc

Info gotten from here

brew install unixodbc
export LDFLAGS="-L/opt/homebrew/Cellar/unixodbc/2.3.9_1/lib"
export CPPFLAGS="-I/opt/homebrew/Cellar/unixodbc/2.3.9_1/include"
pip install pyodbc

Install dbt-sqlserver / dbt-synapse

pip install dbt-sqlserver

or

pip install dbt-synapse

Install ODBC drivers and update the OpenSSL symlink

Info gotten from here for the brew command and from here for the symlink issue

# install the package from homebrew
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=Y brew install msodbcsql17 mssql-tools

# update the link of openssl to 1.1
rm /opt/homebrew/opt/openssl
ln -s /opt/homebrew/Cellar/[email protected]/1.1.1m /opt/homebrew/opt/openssl
export LDFLAGS="-L/opt/homebrew/Cellar/unixodbc/2.3.9_1/lib"
export CPPFLAGS="-I/opt/homebrew/Cellar/unixodbc/2.3.9_1/include"

HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=Y brew install msodbcsql17 mssql-tools

Anders’s trials and tribulations

@Benoit Perigaud I struggled A LOT getting things set up on pure ARM/M1 architecture. TBH, I should have given up and used Rosetta. However I did get things running.

I kept seeing this error message odbcinst: SQLInstallDriverEx failed with Invalid install path. My solution was to manually put the unzipped .tar.gz for msodbcsql18 and mssql-tools18 into /usr/opt/Homebrew/Cellar, then have them symlinked into usr/local/bin automatically by calling brew link. Thanks @Doug Beatty for the debugging help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment