如何在M1 Apple Silicon Mac上成功安装ODBC驱动器以成功使用雪花?
我有问题让ODBC驱动器用于Snowflake,可以在M1 Apple Silicon Mac运行Big Sur上工作。
成功跟随 snowflake网站上的说明使用DSN从命令行(使用iodbctest)测试驱动程序会导致以下错误:
1: SQLDriverConnect = [iODBC][Driver Manager]dlopen(/opt/snowflake/snowflakeodbc/lib/universal/libSnowflake.dylib, 6): no suitable image found. Did find:
/opt/snowflake/snowflakeodbc/lib/universal/libSnowflake.dylib: no matching architecture in universal wrapper
/opt/snowfl (0) SQLSTATE=00000
2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003
将我的雪花驱动器安装到/opt/snowflake/snowflake/snowflakeodbc
,所以这是正确的 - 我可疑这是一个特别的M1问题。我正在使用的2.24.1版本在此处下载镜像,以及/etc/odbcinst.ini
is /opt/snowflake/snowflakeodbc/lib/universal/universal/libsnowflake.dylib
dylib (从我所有的研究中,它都存在并且似乎是对的)。
当我通过r中的DBI运行连接时,我会遇到一个完全不同的错误:
Error: nanodbc/nanodbc.cpp:1021: 00000:
[Snowflake][ODBC] (11560) Unable to locate SQLGetPrivateProfileString function.
在其他stackoverflow帖子中,人们引用了上述错误,这意味着有某种缺失的库(IODBC未正确配置?),但是我've尝试了很多事情。任何指导都很棒。
I'm having issues getting the ODBC driver for Snowflake to work on an M1 Apple Silicon Mac running Big Sur.
Successfully following the instructions on Snowflake's website gets me to the point where testing the driver from the command line (using iodbctest) using the DSN results in the following error:
1: SQLDriverConnect = [iODBC][Driver Manager]dlopen(/opt/snowflake/snowflakeodbc/lib/universal/libSnowflake.dylib, 6): no suitable image found. Did find:
/opt/snowflake/snowflakeodbc/lib/universal/libSnowflake.dylib: no matching architecture in universal wrapper
/opt/snowfl (0) SQLSTATE=00000
2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003
My Snowflake driver is installed to /opt/snowflake/snowflakeodbc
, so that is correct -- I'm suspicious that this is specifically an M1 problem. I'm using the 2.24.1 version of the driver available from the download mirror here, and the path to the driver in /etc/odbcinst.ini
is /opt/snowflake/snowflakeodbc/lib/universal/libSnowflake.dylib
(which exists and seems, from all my research, that it should be right).
When I run a connection via DBI in R, I get a completely different error:
Error: nanodbc/nanodbc.cpp:1021: 00000:
[Snowflake][ODBC] (11560) Unable to locate SQLGetPrivateProfileString function.
In other StackOverflow posts, people have referenced the above error meaning that there is a missing library of some kind (IODBC isn't configured correctly?), but I've tried quite a few things to no avail. Any guidance would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
对此进行了修补,并意识到它是.dmgs&的安装途径的工件。
simba.snowflake.ini
中的预设路径。您需要将雪花驱动器指向iodbc dylib(根据a sidewiping语句在文档中) - 驱动程序最初配置为在路径上的文件夹中查找ODBC Dylib(不是IODBC)。
安装IODBC驱动程序时,请验证其已安装到
/usr/local/iodbc
(这是我的硅Mac将其安装到的位置) - 以及/usr/usr/local/iodbc /lib
具有libiodbc.dylib
。如果是这样,请导航到您已安装的雪花驱动程序目录(应为/etc/snowflake
),然后更改simba.snowflake.ini
file> file(/etc/snowflake/snowflake/ Snowflake/snowflakeodbc/undiville/simba.snowflake.ini
)。您想取消注释&更改最后一行,既不按词&指向通向IODBC Dylib的完整路径(而不是默认值,即ODBC Dylib)。确保评论任何其他ODBCINSTLIB线路,以便仅配置其中一个。这应该使您能够在M1 Mac上启动并运行雪花。
Tinkered with this a bit more and realized it's an artifact of the installation pathways for the .dmgs & the preset paths in
simba.snowflake.ini
.You need to point the Snowflake driver towards the iODBC dylib (as per a sideswiping statement in the docs) -- the driver is originally configured to look for the ODBC dylib (not iODBC) in a folder that's on the path.
When you install the iODBC driver, verify that it is installed to
/usr/local/iODBC
(this was where my Silicon Mac installed it to) -- and that/usr/local/iODBC/lib
haslibiodbc.dylib
in it. If so, navigate to your installed snowflake driver directory (should be/etc/snowflake
) and alter thesimba.snowflake.ini
file (/etc/snowflake/snowflake/snowflakeodbc/universal/simba.snowflake.ini
). You want to uncomment & alter the last line to be both uncommented & point with a full path towards the iODBC dylib (instead of the default, which is the ODBC dylib).Make sure to comment out any other ODBCInstLib line so that only one is configured. That should enable you to get your connection to snowflake up and running on an M1 Mac.
其他解决方案都不适合我,但是 @kiran-kumawat的答案使我走上了一条有效的道路。
问题的核心似乎是ODBC代码正在寻找ARM64架构驱动程序,但Snowflake在X86_64体系结构中提供了它。通过安装X86_64版本的ODBC,我们可以成功与驱动程序交谈。
首先,我卸载了R和Rstudio。 (可能有可能在幕后进行模拟链接或更改现有安装的工作,但我不确定)。
然后安装Rosetta(用于在体系结构之间翻译的苹果软件)和使用它构建的自制版本。我将主要版本的自制版留在原地。
然后使用该版本的Homebrew安装ODBC,R和Rstudio。
然后,我们需要安装雪花驱动器: https:// sfc-repo。 snowflakecomputing.com/odbc/mac64/latest/index.html
单击所有安装提示。
修改您的文件
/usr/local/etc/odbcinst.ini:/usr/local/etc/odbc.ini,
我们
还需要修改simba.snowflake.ini文件。
它有点锁定,因此运行:
然后
找到无调的ODBCINSTLIB线,然后将其更改为:
设置此之后,我能够成功使用此连接:
None of the other solutions worked for me but @kiran-kumawat 's answer set me down a path that worked.
It seems like the core of the issue is that the odbc code is looking for arm64 architecture drivers but Snowflake is providing it in x86_64 architecture. By installing an x86_64 versions of odbc we are able to have it successfully talk to the driver.
First I uninstalled R and Rstudio. (it may be possible to sim-link or change things behind the scenes to make this work with existing installs but I am not sure).
Then install rosetta (apples software for translating between architectures) and a version of homebrew built with it. I am leaving my main version of homebrew in place.
Then use that version of homebrew to install odbc, R, and Rstudio.
We then need to install the snowflake driver: https://sfc-repo.snowflakecomputing.com/odbc/mac64/latest/index.html
Click through all the install prompts.
Modify your files
/usr/local/etc/odbcinst.ini:
/usr/local/etc/odbc.ini
We also need to modify the simba.snowflake.ini file.
It is somewhat locked down so run:
Then
And find the ODBCInstLib line that is uncommented and change it to:
After setting this up I was able to use this connection successfully:
Big Sur是MacOS v11.n
雪花支持MacOS 10.14和10.15 支持的OSS
因此,您尝试做的是不支持的,并且不可能起作用
Big Sur is macOS v11.n
Snowflake supports macOS 10.14 and 10.15 Supported OSs
So what you are trying to do is not supported and is unlikely to work
我们的团队成员之一建议以下步骤,它为我们为Apple M1系列
安装最新的雪花驱动程序
卸载基于M1的Homebrew
/bin/bash -c“ $(curl -fssl https://raw.githubusercontent.com/homebrew/install/master/master/uninstall.sh)”
/bin / 完成后
ARCH -X86_64/bin/bash -c“ $(curl -fssl https://raw.githubusercontent.com/homebrew/install/install/master/master/install.sh)”
Arch -X86_64 BREW安装UnixoDBC
测试
ISQL -V模式
在您的数据库中。
替换“ dsn:< dsn_name>”随后
conn_str:“ driver = {path}; locale = en-us; uid = {user_name}; pwd = {password}; server =< yours> .snowflakecomputing.com; crom =< utf-8; warehouse =< warehouse&gt ;; database =< database&gt ;; schema =< schema&gt ;;“
one of our team member suggested below steps and it worked for us for Apple M1 series
Install the latest snowflake driver
Uninstall m1 based homebrew using cmd
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
Install intel based homebrew - restart terminal when done
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Re-install unixodbc
arch -x86_64 brew install unixodbc
Test
isql -v Pattern
in your database.yml file for connection to snowflake make following change-
replace "dsn: <DSN_NAME>" with following
conn_str: "Driver={PATH};Locale=en-US;uid={USER_NAME};pwd= {PASSWORD};server=<yours>.snowflakecomputing.com;role=<ROLE>;charset=UTF-8;warehouse=<WAREHOUSE>;database=<DATABASE>;schema=<SCHEMA>;"
有人让这个工作吗?我使用Excel W ODBC刷新雪花文件,并尝试了多种移动驾驶员等的方法,并遵循了雪花说明,但从未工作。我确实有相似之处可以运行Windows Arm,但宁愿只在Mac OS中执行此操作
Has anyone gotten this to work? I use excel w odbc to refresh snowflake files and have tried multiple ways to move the drivers etc and followed snowflake instructions but never works. I did get parallels to work running windows arm but would prefer to just do this in Mac OS
我也有一个M1(蒙特雷版本12.0),在测试驾驶员时遇到了类似的问题。但是,当我尝试“真实连接”时,它像魅力一样工作。因此,也许对您进行测试“实际连接”,以避免使用这种测试的时间浪费时间。希望您发现这有用。
I also have a M1 (version Monterey 12.0) and I ran into similar issues when I tested the driver. Nevertheless, when I tried the "real connection" it worked like a charm. So, maybe it would be good for you to go and test the "real connection" to avoid a wasting of time using such testing. Hope you find this useful.