如何在 M1 Apple Silicon Mac 上成功安装 Snowflake 的 ODBC 驱动程序? [英] How do I install the ODBC driver for Snowflake successfully on an M1 Apple Silicon Mac?

查看:58
本文介绍了如何在 M1 Apple Silicon Mac 上成功安装 Snowflake 的 ODBC 驱动程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在让 Snowflake 的 ODBC 驱动程序在运行 Big Sur 的 M1 Apple Silicon Mac 上运行时遇到问题.

I'm having issues getting the ODBC driver for Snowflake to work on an M1 Apple Silicon Mac running Big Sur.

成功遵循 Snowflake 网站上的说明 让我受益匪浅使用 DSN 从命令行(使用 iodbctest)测试驱动程序导致以下错误:

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

我的 Snowflake 驱动程序安装到 /opt/snowflake/snowflakeodbc,所以这是正确的 - 我怀疑这是一个 M1 问题.我正在使用 提供的 2.24.1 版驱动程序下载镜像在这里/etc/odbcinst.ini中驱动的路径是/opt/snowflake/snowflakeodbc/lib/universal/libSnowflake.dylib(存在并且从我所有的研究来看,它应该是正确的).

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

当我通过 R 中的 DBI 运行连接时,出现完全不同的错误:

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. 

在其他 StackOverflow 帖子中,人们引用了上述错误,这意味着缺少某种类型的库(IODBC 配置不正确?),但我尝试了很多方法都无济于事.任何指导都会很棒.

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.

推荐答案

对此进行了更多修改,并意识到它是 .dmgs & 安装路径的产物.simba.snowflake.ini 中的预设路径.

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.

您需要将 Snowflake 驱动程序指向 iODBC dylib(根据文档中的(sideswiping 语句)[https://docs.snowflake.com/en/user-guide/odbc-mac.html#iodbc]) -- 驱动程序最初配置为在路径上的文件夹中查找 ODBC dylib(不是 iODBC).

You need to point the Snowflake driver towards the iODBC dylib (as per a (sideswiping statement)[https://docs.snowflake.com/en/user-guide/odbc-mac.html#iodbc] in the docs) -- the driver is originally configured to look for the ODBC dylib (not iODBC) in a folder that's on the path.

当您安装 iODBC 驱动程序时,请确认它已安装到 /usr/local/iODBC(这是我的 Silicon Mac 安装它的位置)--以及 /usr/local/iODBC/lib 中包含 libiodbc.dylib.如果是这样,导航到您安装的雪花驱动程序目录(应该是 /etc/snowflake)并更改 simba.snowflake.ini 文件(/etc/snowflake/雪花/snowflakeodbc/universal/simba.snowflake.ini).你想取消注释 &将最后一行更改为未注释和指向 iODBC dylib 的完整路径(而不是默认的 ODBC dylib).

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 has libiodbc.dylib in it. If so, navigate to your installed snowflake driver directory (should be /etc/snowflake) and alter the simba.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).

# Darwin specific ODBCInstLib
#   iODBC
ODBCInstLib=/usr/local/iODBC/lib/libiodbcinst.dylib

确保注释掉任何其他 ODBCInstLib 行,以便只配置一个.这将使您能够在 M1 Mac 上启动并运行与 Snowflake 的连接.

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.

这篇关于如何在 M1 Apple Silicon Mac 上成功安装 Snowflake 的 ODBC 驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆