关于RODBC的线程这里是旧的,大约7年前,他们关于安装r-cran-odbc和libiodbc2-dev的解决方案不起作用。从R3.5.1开始,我得到了与7年前相同的错误
install.packages("RODBC", keep_outputs = T)
configure: error: "ODBC headers sql.h and sqlext.h not found"
ERROR: configuration failed for package ‘RODBC’
* removing ‘/opt/conda/lib/R/library/RODBC’尽管已经安装了上述软件包。所以
从R3.5.1(R和Ubuntu的最新版本)?
libiodbc2-dev和r-cran-rodbc无法解决这个问题。
规格
$ uname -a Linux 370485a13e40 4.9.93-linuxkit-aufs #1 SMP Wed Jun 6 16:55:56 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
sql.h位于以下位置
$ apt-file sql.h libdballe-dev: /usr/include/dballe/sql/sql.h libiodbc2-dev: /usr/include/iodbc/sql.h libmailutils-dev: /usr/include/mailutils/sql.h libwine-dev: /usr/include/wine/windows/sql.h libwine-development-dev: /usr/include/wine-development/wine/windows/sql.h mingw-w64-common: /usr/share/mingw-w64/include/sql.h mingw-w64-i686-dev: /usr/i686-w64-mingw32/include/sql.h mingw-w64-x86-64-dev: /usr/x86_64-w64-mingw32/include/sql.h pike7.8-core: /usr/lib/pike7.8/include/sql.h pike8.0-core: /usr/lib/pike8.0/include/sql.h unixodbc-dev: /usr/include/sql.h
和
# apt-file search /sqlext.h libiodbc2-dev: /usr/include/iodbc/sqlext.h libwine-dev: /usr/include/wine/windows/sqlext.h libwine-development-dev: /usr/include/wine-development/wine/windows/sqlext.h mingw-w64-common: /usr/share/mingw-w64/include/sqlext.h mingw-w64-i686-dev: /usr/i686-w64-mingw32/include/sqlext.h mingw-w64-x86-64-dev: /usr/x86_64-w64-mingw32/include/sqlext.h unixodbc-dev: /usr/include/sqlext.h发布于 2019-01-07 00:12:53
可以通过从conda安装r-rodbc包来解决缺少的标头问题,以便
RUN conda install --quiet --yes \
'r-base=3.5.1' \
'r-rodbc=1.3*' \然后,您将得到以下错误
hecking for library containing SQLTables... no
configure: error: "no ODBC driver manager found"
ERROR: configuration failed for package ‘RODBC’
* removing ‘/opt/conda/lib/R/library/RODBC’
* restoring previous ‘/opt/conda/lib/R/library/RODBC’为此,您需要从apt获得r-cran-odbc、unixodbc和‘unixodbc’(仅仅unixodbc是不够的),以便您的Dockerfile变为
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
ARG BASE_CONTAINER=jupyter/minimal-notebook
FROM $BASE_CONTAINER
LABEL maintainer="Jupyter Project "
USER root
# R pre-requisites
RUN apt-get update && \
apt-get install -y --no-install-recommends \
fonts-dejavu \
tzdata \
unixodbc \
unixodbc-dev \
r-cran-rodbc \
gfortran \
gcc && \
rm -rf /var/lib/apt/lists/*
USER $NB_UID
# R packages
RUN conda install --quiet --yes \
'r-base=3.5.1' \
'r-rodbc=1.3*' \
'unixodbc=2.3.*' \
'r-irkernel=0.8*' \
'r-plyr=1.8*' \
'r-devtools=1.13*' \
'r-tidyverse=1.2*' \
'r-shiny=1.2*' \
'r-rmarkdown=1.11*' \
'r-forecast=8.2*' \
'r-rsqlite=2.1*' \
'r-reshape2=1.4*' \
'r-nycflights13=1.0*' \
'r-caret=6.0*' \
'r-rcurl=1.95*' \
'r-crayon=1.3*' \
'r-randomforest=4.6*' \
'r-htmltools=0.3*' \
'r-sparklyr=0.9*' \
'r-htmlwidgets=1.2*' \
'r-hexbin=1.27*' && \
conda clean -tipsy && \
fix-permissions $CONDA_DIRhttps://askubuntu.com/questions/1107461
复制相似问题