Giter Club home page Giter Club logo

Comments (49)

David-Engel avatar David-Engel commented on May 16, 2024 29

@nico525 @fonnesbeck M1 ARM support is being worked on. Barring any blocking issues, it is planned be in our next regular release at the end of July.

from homebrew-mssql-release.

vwarchu avatar vwarchu commented on May 16, 2024 11

@wizardion - I'm filling in for David at the moment and can say that the end-of-July release is on track to include M1 ARM support.

from homebrew-mssql-release.

victoriawallace avatar victoriawallace commented on May 16, 2024 6

Hi @vwarchu - any update on the release for M1 ARM support?

from homebrew-mssql-release.

JayBaywatch avatar JayBaywatch commented on May 16, 2024 6

just wanted to circle back to say thanks and that worked.

In case it's ever helpful to anyone else the steps are below.

  1. Uninstall msodbc 17: brew remove msodbcsql17 mssql-tools
  2. Remove any symlinks to odbcinst.ini and odbc.ini
  3. Remove pyodbc, if applicable (pip uninstall pyodbc)
  4. Install a separate instance of homebrew as outlined below:
    https://medium.com/swlh/run-x86-terminal-apps-like-homebrew-on-your-new-m1-mac-73bdc9b0f343
  5. in a terminal running Rosetta (as described in step 4) do the following steps below.

from homebrew-mssql-release.

wizardion avatar wizardion commented on May 16, 2024 4

@David-Engel is there any news about the new version of this driver for M1 ARM? July is coming soon...

from homebrew-mssql-release.

basnijholt avatar basnijholt commented on May 16, 2024 2

Thanks a lot @JayBaywatch!

I have written up some instructions to get pyodbc to work on the M1 as well:

One can only use pyodbc when using Rosetta (x86 emulation).
Follow the steps below.

Uninstall M1 versions of brew packages (if installed at all):

brew uninstall unixodbc msodbcsql17 mssql-tools freetds

Install x86 Homebrew alongside the ARM M1 homebrew:

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Then use x86 homebrew like arch -x86_64 /usr/local/bin/brew install or use the following alias (add to ~/.bash_profile)

# Relies on having installed x86 brew like:
# arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
alias x86brew="arch -x86_64 /usr/local/bin/brew"
alias brew="/opt/homebrew/bin/brew"  # M1 version, to avoid from using x86 version accidentally

Install the ODBC packages.

x86brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
x86brew update
HOMEBREW_ACCEPT_EULA=Y x86brew install msodbcsql17 mssql-tools

Create an x86 conda env with:

ENV_NAME="rosetta"
CONDA_SUBDIR=osx-64 conda create -n $ENV_NAME python
conda activate $ENV_NAME
conda config --env --set subdir osx-64

or if using micromamba:

ENV_NAME="rosetta"
CONDA_SUBDIR=osx-64 micromamba create -n $ENV_NAME python
micromamba activate $ENV_NAME

from homebrew-mssql-release.

MrRobot245 avatar MrRobot245 commented on May 16, 2024 1

Mine did work with Rosetta2,

Kill the native brew version, duplicate your terminal all and check the Rosetta2 box and reinstall brew/MSSQL

Until there's a arm64 version that's what I'll be doing.

from homebrew-mssql-release.

David-Engel avatar David-Engel commented on May 16, 2024 1

@victoriawallace End of July == the last day of the month. If you want to get notifications of driver releases, you can subscribe to our blog at https://techcommunity.microsoft.com/t5/sql-server/bg-p/SQLServer/label-name/SQLServerDrivers

from homebrew-mssql-release.

RomkaSk avatar RomkaSk commented on May 16, 2024 1

Everything works! Thank you!

from homebrew-mssql-release.

David-Engel avatar David-Engel commented on May 16, 2024 1

@RomkaSk Thanks for the heads up about the release notes. I just edited those and the mac install page to note the added M1 support. It should be reflected after tomorrow morning. Glad it's working for you!

from homebrew-mssql-release.

JayBaywatch avatar JayBaywatch commented on May 16, 2024 1

Thanks, I had tried otool and everything seemed fine.

otool -L /opt/homebrew/lib/libmsodbcsql.17.dylib
/opt/homebrew/lib/libmsodbcsql.17.dylib:
/opt/homebrew/opt/msodbcsql17/lib/libmsodbcsql.17.dylib (compatibility version 0.0.1, current version 8.1.1)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
/opt/homebrew/lib/libodbcinst.2.dylib (compatibility version 3.0.0, current version 3.0.0)
/System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos (compatibility version 5.0.0, current version 6.0.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)

sqlcmd and isql both work, so I guess I have to assume that this is a pyodbc issue at this point.

edit: unsure if those compatibility versions are normal or not.

from homebrew-mssql-release.

v-chojas avatar v-chojas commented on May 16, 2024

No support for ARM64 at the moment.

from homebrew-mssql-release.

MrRobot245 avatar MrRobot245 commented on May 16, 2024

That's what I figured, but it didn't get me an arch error so I thought it was something I could fix.
Would this work under Rosetta2?

from homebrew-mssql-release.

v-chojas avatar v-chojas commented on May 16, 2024

If your application and its dependencies are also consistently x86_64, I don't see why not.

from homebrew-mssql-release.

LukeGahan avatar LukeGahan commented on May 16, 2024

Running into the same issue report by @MrRobot245 and have been unable to resolve. Happy to provide more information if needed, understand support is only for x86_64 but would be good to know if there is a workaround to make use of Rosetta2

from homebrew-mssql-release.

LukeGahan avatar LukeGahan commented on May 16, 2024

Thanks @MrRobot245, those instructions worked for me, appreciate the help.

from homebrew-mssql-release.

nico525 avatar nico525 commented on May 16, 2024

Is there any timeline on arm? I do not want to remove and reinstall my full software stack just because of this ODBC driver
FreeTDS works so far, but I am deploying to a Unix environment and would like to develop more closely to that environment

from homebrew-mssql-release.

fonnesbeck avatar fonnesbeck commented on May 16, 2024

Is there any hope for a M1-compatible update, or is this not happening?

from homebrew-mssql-release.

fonnesbeck avatar fonnesbeck commented on May 16, 2024

Thanks for the update.

from homebrew-mssql-release.

victoriawallace avatar victoriawallace commented on May 16, 2024

Hi @David-Engel

I've tried reinstalling the ODBC Driver 17 for macOS following the release on Saturday -

$ odbcinst -j                                                                          
unixODBC 2.3.9
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /Users/vikki.wallace/odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
$ cat /etc/odbcinst.ini                                           
[ODBC Driver 13 for SQL Server]
Description=Microsoft ODBC Driver 13 for SQL Server
Driver=/usr/local/lib/libmsodbcsql.13.dylib
UsageCount=2

[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/opt/homebrew/lib/libmsodbcsql.17.dylib
UsageCount=5
$ ls -la /opt/homebrew/lib/libmsodbcsql.17.dylib  
lrwxr-xr-x  1 vikki.wallace  admin  56 31 Jul 16:54 /opt/homebrew/lib/libmsodbcsql.17.dylib -> ../Cellar/msodbcsql17/17.8.1.1/lib/libmsodbcsql.17.dylib

but I still can't connect -

>>> pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE=qai;UID='+username+';PWD='+password)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/homebrew/lib/libmsodbcsql.17.dylib' : file not found (0) (SQLDriverConnect)")
>>> pyodbc.connect('DRIVER={/opt/homebrew/Cellar/msodbcsql17/17.8.1.1/lib/libmsodbcsql.17.dylib};SERVER='+server+';DATABASE=qai;UID='+username+';PWD='+password)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/homebrew/Cellar/msodbcsql17/17.8.1.1/lib/libmsodbcsql.17.dylib' : file not found (0) (SQLDriverConnect)")

Can you please advise?

Thanks

from homebrew-mssql-release.

RomkaSk avatar RomkaSk commented on May 16, 2024

@victoriawallace

Try to use connection string like this

driver = 'ODBC Driver 17 for SQL Server'

SQLALCHEMY_CONNECTION_STRING = 'mssql+pyodbc://{2}:{3}@{0}/{1}?driver={4}&Port=1433'.format(
        DB_SERVER, DB_NAME, DB_USER, DB_PASSWORD, driver)

and after put it in sqlalchemy.engine.create_engine()

from homebrew-mssql-release.

zeljkolazic avatar zeljkolazic commented on May 16, 2024

Still doesn't work for me on Air M1. With driver = 'ODBC Driver 17 for SQL Server' , I'm still getting

Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib' : file not found

any help?

from homebrew-mssql-release.

v-chojas avatar v-chojas commented on May 16, 2024

/usr/local/lib is where the x86 one should be. Did you install from a native ARM64 brew or one running under Rosetta2 emulation?

from homebrew-mssql-release.

zeljkolazic avatar zeljkolazic commented on May 16, 2024

I installed it from the native ARM64 brew. When installed from brew under Rosetta2, the path is ../Cellar/msodbcsql17/17.8.1.1lib/libmsodbcsql.17.dylib, and it works fine in that case. But the point is that I want to remove brew under Rosetta2 and keep just the native one

from homebrew-mssql-release.

v-chojas avatar v-chojas commented on May 16, 2024

Please try to remove it from the Rosetta2 brew, then install from the native one.
Also make sure you are using native isql when testing connection, i.e. when running which isql result should be in /opt/homebrew/ instead of /usr/local.

from homebrew-mssql-release.

absantiago avatar absantiago commented on May 16, 2024

@RomkaSk I'm using the driver as you said 'driver = 'ODBC Driver 17 for SQL Server' ' but I'm still getting the error below

Can't open lib '/opt/homebrew/lib/libmsodbcsql.17.dylib' : file not found

Any help ?

from homebrew-mssql-release.

v-chojas avatar v-chojas commented on May 16, 2024

Are you using native arm64 isql?

from homebrew-mssql-release.

absantiago avatar absantiago commented on May 16, 2024

@v-chojas I think yes, how can I check this ?

PS : When I type isql --version I get : unixODBC 2.3.9

from homebrew-mssql-release.

JayBaywatch avatar JayBaywatch commented on May 16, 2024

I am having similar problems with the arm64 release.

I was getiting:
Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/homebrew/lib/libmsodbcsql.17.dylib' : file not found (0) (SQLDriverConnect)")

Then I noticed that /opt/homebrew/lib/libmsodbcsql.17.dylib is linked to /opt/homebrew/Cellar/msodbcsql17/17.8.1.1/lib/libmsodbcsql.17.dylib

so I updated odbcinst.ini
[ODBC Driver 17 for SQL Server] Description=Microsoft ODBC Driver 17 for SQL Server #Driver=/opt/homebrew/lib/libmsodbcsql.17.dylib Driver=/opt/homebrew/Cellar/msodbcsql17/17.8.1.1/lib/libmsodbcsql.17.dylib UsageCount=1

But that didn't help.
Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/homebrew/Cellar/msodbcsql17/17.8.1.1/lib/libmsodbcsql.17.dylib' : file not found (0) (SQLDriverConnect)")

Has anyone actually gotten this to work on Apple arm64 silicon? I tried on 2 separate machines with the same result.

from homebrew-mssql-release.

yitam avatar yitam commented on May 16, 2024

I've installed homebrew from scratch and then ODBC driver and mssql-tools

  1. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
  3. brew update
  4. HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=Y brew install msodbcsql17 mssql-tools

image

I have no problem running a simple SELECT @@version using isql

image

from homebrew-mssql-release.

JayBaywatch avatar JayBaywatch commented on May 16, 2024

something in our environments are different.
Are those the defaults for you? My defaults are in /etc/ while yous appear to be in /opt/homebrew/etc/

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

I do have /opt/homebrew/lib/libmsodbcsql.17.dylib but I get errors that
('01000', "[01000] [unixODBC][Driver Manager]Can't open lib /opt/homebrew/lib/libmsodbcsql.17.dylib : file not found (0) (SQLDriverConnect)")

fresh install, and just got the same behavior.

from homebrew-mssql-release.

yitam avatar yitam commented on May 16, 2024

Did you install unixodbc using homebrew, @JayBaywatch ?
My env was basically clean... it was only used for testing installation. Please make sure your homebrew was installed in the native mode not Rosetta2

from homebrew-mssql-release.

JayBaywatch avatar JayBaywatch commented on May 16, 2024

the first atempt, I installed unixodbc and freetds from homebrew. subsequent attempts, I let homebrew pull the dependencies from the msodbc recipe.

from homebrew-mssql-release.

JayBaywatch avatar JayBaywatch commented on May 16, 2024

/usr/bin/arch reports arm64

from homebrew-mssql-release.

v-chojas avatar v-chojas commented on May 16, 2024

Please remove and try again the installation.

from homebrew-mssql-release.

JayBaywatch avatar JayBaywatch commented on May 16, 2024

hm, that works for isql now. but still no dice from python. Although I am no longer getting a complaint about/opt/homebrew/lib/libmsodbcsql.17.dylib not being found.

This is progress, thank you.

from homebrew-mssql-release.

yitam avatar yitam commented on May 16, 2024

Great, @JayBaywatch !

For the others, to quickly check if isql is native, run file /opt/homebrew/bin/isql
The expected output is /opt/homebrew/bin/isql: Mach-O 64-bit executable arm64

from homebrew-mssql-release.

JayBaywatch avatar JayBaywatch commented on May 16, 2024

even using a minimalist sample from python I get errors.
server = 'DB-DEV01'
username = 'user'
password = 'p@assword'
pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE=Master;UID='+username+';PWD='+password)

Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/homebrew/lib/libmsodbcsql.17.dylib' : file not found (0) (SQLDriverConnect)")

isql still works though. weird.

from homebrew-mssql-release.

v-chojas avatar v-chojas commented on May 16, 2024

Does otool -L '/opt/homebrew/lib/libmsodbcsql.17.dylib' show any "file not found" errors?
You can also use dtruss to determine which file exactly it is not found.

from homebrew-mssql-release.

v-chojas avatar v-chojas commented on May 16, 2024

You are using ARM64 Python and pyODBC? https://github.com/mkleehammer/pyodbc/issues <- you can ask there

from homebrew-mssql-release.

JayBaywatch avatar JayBaywatch commented on May 16, 2024

hey, thanks for that. There is a suggestion over there to build from source. I can try that.

from homebrew-mssql-release.

zeljkolazic avatar zeljkolazic commented on May 16, 2024

hey, thanks for that. There is a suggestion over there to build from source. I can try that.

For me, it didn't work when running Python via Rosseta emulation although I had drivers properly installed. Switching to python 3.9.5 which runs nativly on ARM solved the issue.
So, you need to run both python and msssql drivers nativly in order to make it work.

from homebrew-mssql-release.

v-chojas avatar v-chojas commented on May 16, 2024

If everything is consistently running in emulation (from application to driver) that should work too, and would be your only choice if you have an x86 app that you need to use with the ODBC driver.

However, everything running natively in ARM mode should also work. The key point to remember is to not mix the two architectures' binaries together.

from homebrew-mssql-release.

JayBaywatch avatar JayBaywatch commented on May 16, 2024

from homebrew-mssql-release.

JayBaywatch avatar JayBaywatch commented on May 16, 2024

from homebrew-mssql-release.

joelharkes avatar joelharkes commented on May 16, 2024

i also get this error when i install v18 of the drivers 🤷

Can't open lib '/opt/homebrew/lib/libmsodbcsql.17.dylib'

from homebrew-mssql-release.

v-makouz avatar v-makouz commented on May 16, 2024

@joelharkes Why is it trying to open v17 dylib if you installed v18? What's the command that produces that error?

from homebrew-mssql-release.

joelharkes avatar joelharkes commented on May 16, 2024

Idk, maybe i installed it earlier and it can't find it. But I uninstalled it yet it still looks for it. How could I debug it further?

from homebrew-mssql-release.

v-makouz avatar v-makouz commented on May 16, 2024

What are the exact commands you're using?

from homebrew-mssql-release.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.