gpt4 book ai didi

r - 如何在 macOS 上安装和定位 ODBC 头文件 sql.h 和 sqlext.h

转载 作者:行者123 更新时间:2023-12-02 01:18:16 24 4
gpt4 key购买 nike

我正在尝试安装包 RODBC在 OS 10.12 的 MacBook Air 上通过 CRAN。

我收到以下错误:

Installing package into ‘/Users/aaron.samuels/Library/R/3.3/library’
(as ‘lib’ is unspecified)
Package which is only available in source form, and may need compilation of
C/C++/Fortran: ‘RODBC’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘RODBC’

trying URL 'https://cran.rstudio.com/src/contrib/RODBC_1.3-14.tar.gz'
Content type 'application/x-gzip' length 1163799 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

* installing *source* package ‘RODBC’ ...
** package ‘RODBC’ successfully unpacked and MD5 sums checked
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files...
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sql.h usability... no
checking sql.h presence... no
checking for sql.h... no
checking sqlext.h usability... no
checking sqlext.h presence... no
checking for sqlext.h... no
configure: error: "ODBC headers sql.h and sqlext.h not found"
ERROR: configuration failed for package ‘RODBC’
* removing ‘/Users/aaron.samuels/Library/R/3.3/library/RODBC’
Warning in install.packages :
installation of package ‘RODBC’ had non-zero exit status

下载的源码包在

/private/var/folders/3l/nrtzvm592736jz_qh_5l1wbmffq3bz/T/RtmpeuPUR0/downloaded_packages

关于如何轻松安装这些 header 并随后成功安装 RODBC 有什么建议吗?

最佳答案

我找到了启用 ODBC driver 的官方 Microsoft 源代码.

你只需要在终端上运行这行

/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
brew install --no-sandbox msodbcsql17 mssql-tools

关于r - 如何在 macOS 上安装和定位 ODBC 头文件 sql.h 和 sqlext.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41569272/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com