由于微信不允许外部链接,你需要点击文章尾部左下角的 "阅读原文",才能访问文中链接。

记录一下今天在 Anaconda3 环境下 R==3.4.3 中安装 ggraph 的一些问题。

install.packages("ggraph") 发现 libudunits2.so was not found 错误:

> install.packages("ggraph")
......
checking for gcc... x86_64-conda_cos6-linux-gnu-cc
checking whether we are using the GNU C compiler... yes
checking whether x86_64-conda_cos6-linux-gnu-cc accepts -g... yes
checking for x86_64-conda_cos6-linux-gnu-cc option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking udunits2/udunits2.h usability... no
checking udunits2/udunits2.h presence... no
checking for udunits2/udunits2.h... no
checking for ut_read_xml in -ludunits2... no
configure: error: in `/tmp/RtmpDRI4FZ/R.INSTALL7d4f2d342516/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.
--------------------------------------------------------------------------------

See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/usr/local/SoftWare/Anaconda3/lib/R/library/units’
ERROR: dependency ‘units’ is not available for package ‘ggforce’
* removing ‘/usr/local/SoftWare/Anaconda3/lib/R/library/ggforce’
ERROR: dependency ‘ggforce’ is not available for package ‘ggraph’
* removing ‘/usr/local/SoftWare/Anaconda3/lib/R/library/ggraph’

The downloaded source packages are in
       ‘/tmp/RtmpqBo0sm/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("ggraph") :
 installation of package ‘units’ had non-zero exit status
2: In install.packages("ggraph") :
 installation of package ‘ggforce’ had non-zero exit status
3: In install.packages("ggraph") :
 installation of package ‘ggraph’ had non-zero exit status

> install.packages("units")
......
checking for ut_read_xml in -ludunits2... no
configure: error: in `/tmp/Rtmp9xeJYe/R.INSTALL1e7523367a6/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.
--------------------------------------------------------------------------------

See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/usr/local/SoftWare/Anaconda3/lib/R/library/units’

The downloaded source packages are in
       ‘/tmp/RtmpqBo0sm/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("units") :
 installation of package ‘units’ had non-zero exit status

libudunits2.so not found,是 udunits2 相关的库存在问题,CentOS 下可以使用 sudo yum install udunits2-devel 解决,在这里也可以使用 conda 同时解决 units 安装及 udunits2 的库错误。

$ conda install r-units
#没有报错,正常安装成功

$ R
......
> library(units)
> install.packages("ggraph")
......
** R
** inst
** preparing package for lazy loading
Error : object ‘scale_type’ is not exported by 'namespace:ggplot2'
ERROR: lazy loading failed for package ‘ggforce’
* removing ‘/usr/local/SoftWare/Anaconda2/lib/R/library/ggforce’
ERROR: dependency ‘ggforce’ is not available for package ‘ggraph’
* removing ‘/usr/local/SoftWare/Anaconda2/lib/R/library/ggraph’

The downloaded source packages are in
       ‘/tmp/RtmpDK4vST/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("ggraph") :
 installation of package ‘ggforce’ had non-zero exit status
2: In install.packages("ggraph") :
 installation of package ‘ggraph’ had non-zero exit status

> library(ggforce)
Error in library(ggforce) : there is no package called ‘ggforce’
> install.packages("ggforce")
......
** inst
** preparing package for lazy loading
Error : object ‘scale_type’ is not exported by 'namespace:ggplot2'
ERROR: lazy loading failed for package ‘ggforce’
* removing ‘/usr/local/SoftWare/Anaconda2/lib/R/library/ggforce’
......

> install.packages("ggplot2")
......
Error : object ‘enexprs’ is not exported by 'namespace:rlang'
ERROR: lazy loading failed for package ‘ggplot2’
......

从 rlang 开始,依次更新 rlang、ggplot2、ggforce 包。

> install.packages("rlang")
trying URL 'http://mirror.lzu.edu.cn/CRAN/src/contrib/rlang_0.2.2.tar.gz'
Content type 'application/octet-stream' length 325128 bytes (317 KB)
==================================================
downloaded 317 KB
......

> install.packages("ggplot2")
trying URL 'http://mirror.lzu.edu.cn/CRAN/src/contrib/ggplot2_3.0.0.tar.gz'
Content type 'application/octet-stream' length 2847050 bytes (2.7 MB)
==================================================
downloaded 2.7 MB
......

> install.packages("ggforce")
trying URL 'http://mirror.lzu.edu.cn/CRAN/src/contrib/ggforce_0.1.3.tar.gz'
Content type 'application/octet-stream' length 1489319 bytes (1.4 MB)
==================================================
downloaded 1.4 MB
......

最后,安装 ggraph,问题解决。

> install.packages("ggraph")
trying URL 'http://mirror.lzu.edu.cn/CRAN/src/contrib/ggraph_1.0.2.tar.gz'
Content type 'application/octet-stream' length 2607278 bytes (2.5 MB)
==================================================
downloaded 2.5 MB
....

> library(ggraph)
Loading required package: ggplot2
>

最后,简单总结一下:

ggraph_1.0.2 安装需要满足两个依赖:R (≥ 2.10), ggplot2 (≥ 2.0.0)。各种包相互依赖调用,根据 log 可定位哪一个包存在问题,然后逐一去解决。

object ‘enexprs’ is not exported by ‘namespace:rlang’,某个包(rlnag)无法加载特定对象(enexprs)可能有两个原因:

  • 该包没有安装。

  • 该包版本问题,导致目标对象(函数)发生增删处理。

·end·

—如果喜欢,快分享给你的朋友们吧—

我们一起愉快的玩耍吧

本文分享自微信公众号 - 生信科技爱好者(bioitee)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。

Anaconda 环境下 R 包 ggraph_1.0.2 安装小记的更多相关文章

  1. win10+anaconda环境下pyqt5+qt tools+eric6.18安装及汉化过程

    最近需要用python编写一个小程序的界面,选择了pyqt5+eric6的配套组合,安装过程中遇到一些坑,特此记录.参考书籍是电子工业出版社的<PyQt5快速开发与实战>. 因为我使用an ...

  2. win7 IIS7环境下部署PHP 7.0

    最近在本机电脑win7 II7环境下部署PHP 7.0遇到一些问题,将之记录下来 简要步骤如下: 1.到php官网下载php,由于是IIS环境要下载非线程安全的版本,我下载的是7.0.13 2.解压到 ...

  3. Windows环境下Android Studio v1.0安装教程

    Windows环境下Android Studio v1.0安装教程 准备工具 JDK安装包. 要求:JDK 7以及以上版本. Android Studio安装文件. Windows: exe(包含SD ...

  4. DOS环境下含包并引用第三方jar的java程序的编译及运行

    DOS环境下含包并引用第三方jar的java程序的编译及运行 1.程序目录机构 bin:class文件生成目录 lib:第三方jar包目录 src:源程序文件目录 2.程序代码: 3.程序编译 jav ...

  5. 【转】Windows环境下Android Studio v1.0安装教程

    原文网址:http://ask.android-studio.org/?/article/9 http://android-studio.org/index.php/docs/experience/1 ...

  6. 编译mapnik(win7 环境下vs2008编译mapnik 0.7.1 成功)

    编译mapnik(win7 环境下vs2008编译mapnik 0.7.1 成功) ------by  wangsh 2012.02.22 Mapnik 是一个开源的 Python/C++ 地图渲染引 ...

  7. Anaconda环境下安装库

    使用anaconda环境下使用pycharm后,有些其他库也想安装,但开始在python.exe目录下安装没成功,因为pycharm用的环境已经不是原始的python.exe解释器了.就总结了一些安装 ...

  8. 在Anaconda环境下使用Jupyter Notebook

    !!!Anaconda 和 Jupyter Notebook 在 zsh 环境下不能正常使用! 启动建立的 Anaconda 环境 安装 nb_conda:conda install nb_conda ...

  9. 实验三:xen环境下的第一个虚拟机的安装

    实验名称: xen环境下的第一个虚拟机的安装 实验环境: 我们这里继续上面实验二来完成这个实验: 环境则是xen的安装环境,如下图: 开启虚拟机的的硬件辅助虚拟化功能: 实验要求: 这里我们通过安装b ...

  10. 20180831-Linux环境下Python 3.6.6 的安装说明

    20180831-Linux环境下Python 3.6.6 的安装说明 摘要:Python3 安装部署,普通用户,编译安装 Author: andy_yhm@yeah.net Date: 201808 ...

随机推荐

  1. 中高等DP总结(更新中

    1.CF613D Kingdom and its Cities 题意:给定一棵树,每个询问给出一些关键点,要求删掉最少的点使这些点两两不联通,无解输出-1. 思路:先判无解:只要有一个关键点的父亲也是 ...

  2. 微软博客上几篇 Semantic-kernel (SK)文章

    自从最近微软开源Semantic-kernel  来帮助开发人员在其应用程序中使用AI大型语言模型(LLM)以来,Microsoft一直在忙于改进它,发布了有关如何使用它的新指南并发布了5篇文章介绍他 ...

  3. 开发一个二方包,优雅地为系统接入ELK(elasticsearch+logstash+kibana)

    去年公司由于不断发展,内部自研系统越来越多,所以后来搭建了一个日志收集平台,并将日志收集功能以二方包形式引入各个自研系统,避免每个自研系统都要建立一套自己的日志模块,节约了开发时间,管理起来也更加容易 ...

  4. 基于Label studio实现UIE信息抽取智能标注方案,提升标注效率!

    基于Label studio实现UIE信息抽取智能标注方案,提升标注效率! 项目链接见文末 人工标注的缺点主要有以下几点: 产能低:人工标注需要大量的人力物力投入,且标注速度慢,产能低,无法满足大规模 ...

  5. 数据挖掘系统聚类—R实现

    系统聚类法 聚类就是按照某个特定标准把一个数据集分割成不同的类或簇,最后的结果是希望同类之间的差异性尽可能小,不同类之间的差异性尽可能大.不同的类具有能够表达异于其他类的指标,这样针对不同的类,后续就 ...

  6. pandas之缺失值处理

    在一些数据分析业务中,数据缺失是我们经常遇见的问题,缺失值会导致数据质量的下降,从而影响模型预测的准确性,这对于机器学习和数据挖掘影响尤为严重.因此妥善的处理缺失值能够使模型预测更为准确和有效. 为什 ...

  7. 四月十二号java基础知识

    1.面向对象的编程思想是力图使在计算机语言中对事物的描述与现实世界中该事物的本来面目尽可能地一致.2.类(class)和对象(object)是面向对象程序设计方法中最核心的概念3.类是对某一事物的描述 ...

  8. C# Kafka重置到最新的偏移量,即从指定的Partition订阅消息使用Assign方法

    在使用Kafka的过程中,消费者断掉之后,再次开始消费时,消费者会从断掉时的位置重新开始消费. 场景再现:比如昨天消费者晚上断掉了,今天上午我们会发现kafka消费的数据不是最新的,而是昨天晚上的数据 ...

  9. 容易忽视的细节:Log4j 配置导致的零点接口严重超时

    作者:vivo 互联网服务器团队- Jiang Ye 本文详细的记录了一次0点接口严重超时的问题排查经历.本文以作者自身视角极具代入感的描绘了从问题定位到具体的问题排查过程,并通过根因分析并最终解决问 ...

  10. Python-pytest-repeat的简单使用

    前言: 一.简介 pytest-repeat是pytest的插件,重复执行单个用例,或多个测试用例,并指定重复次数. 二.安装 1.执行如下命令 pip3 install pytest-repeat ...