首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Ubuntu中安装"choroplethr“

在Ubuntu中安装"choroplethr“
EN

Stack Overflow用户
提问于 2018-11-23 05:28:42
回答 1查看 361关注 0票数 1

我在尝试安装“合唱团”

我读过以下与此相关的错误:

他们的建议是安装我已经安装的东西。我已经将libudunits2安装在一个标准位置,包括:

代码语言:javascript
复制
$ sudo apt-get install libudunits2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libudunits2-dev is already the newest version (2.2.26-1).

我可以看到标题:

代码语言:javascript
复制
$ ll /usr/include/ | grep unit
-rw-r--r--   1 root root  39998 Jan  5  2018 udunits2.h
-rw-r--r--   1 root root   5195 Jan  5  2018 udunits.h

但是,在安装时,我会得到以下错误:

代码语言:javascript
复制
$ R
R version 3.5.1 (2018-07-02) -- "Feather Spray"

> install.package("choroplethr", dep=T)
...
configure: error: in `/tmp/RtmpWC06JV/R.INSTALL7cbb4928db67/units':
configure: error: 
--------------------------------------------------------------------------------
  Configuration failed because libudunits2.so was not found. Try installing:
    * deb: libudunits2-dev (Debian, Ubuntu, ...)
    * rpm: udunits2-devel (Fedora, EPEL, ...)
    * brew: udunits (OSX)
  If udunits2 is already installed in a non-standard location, use:
    --configure-args='--with-udunits2-lib=/usr/local/lib'
  if the library was not found, and/or:
    --configure-args='--with-udunits2-include=/usr/include/udunits2'
  if the header was not found, replacing paths with appropriate values.
  You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.
--------------------------------------------------------------------------------

我做过这些设置,但是

代码语言:javascript
复制
install.packages("udunits2", configure.args = '--with-udunits2-include=/usr/include/udunits2')

-----Error: libudunits2.a not found-----
     If the udunits2 library is installed in a non-standard location,
     use --configure-args='--with-udunits2-lib=/usr/local/lib' for example,
     or --configure-args='--with-udunits2-include=/usr/include/udunits2'
     replacing paths with appropriate values for your installation.
     You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIB
     environment variables.
     If udunits2 is not installed, please install it.
     It is required for this package.

我遗漏了什么?这是OSX包吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-11-23 07:17:44

对于使用R3.5的Ubuntu,您可以使用那些在CRAN,c.f上为您带来R包的人提供的C2d4u3.5PPAhttps://cran.r-project.org/bin/linux/ubuntu/README.htmlhttp://dirk.eddelbuettel.com/blog/2017/12/22/

代码语言:javascript
复制
sudo add-apt-repository ppa:marutter/c2d4u3.5
sudo apt-get update

之后,您可以为大多数CRAN包安装二进制包:

代码语言:javascript
复制
sudo apt-get install r-cran-choroplethr

这应该适用于CRAN任务视图中提到的所有包。

此外,我尝试使用docker再现您的安装问题:

代码语言:javascript
复制
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
 && apt-get install --yes --no-install-recommends gnupg ca-certificates \
 && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 \
 && echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/" >> /etc/apt/sources.list \
 && apt-get update \
 && apt-get install  --yes --no-install-recommends r-base-dev libudunits2-dev \
 && Rscript -e 'install.packages(c("units", "udunits2"))'

然而,这个形象是毫无问题地建立起来的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53441069

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档