首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ggpubr的安装问题

ggpubr的安装问题
EN

Stack Overflow用户
提问于 2020-06-13 09:18:28
回答 7查看 9K关注 0票数 1

我正在尝试按如下方式安装R包ggpubr (在Docker映像上)--所有其他库都已成功安装:

代码语言:javascript
复制
install.packages("~/mypackages/ggpubr_0.3.0.tar.gz", repos=NULL, type="source")

但我得到了以下错误:

代码语言:javascript
复制
2020-06-13T08:55:43.6605261Z [0m[91mERROR: dependencies 'ggrepel', 'ggsci', 'cowplot', 'ggsignif', 'polynom', 'rstatix' are not available for package 'ggpubr'
2020-06-13T08:55:43.6608879Z [0m[91m* removing '/usr/local/R/library/ggpubr'

我试着用不同的方式安装它:

代码语言:javascript
复制
# Failed with the message that a mirror must be specified
install.packages("ggpubr")

# Failed due to dependencies
install.packages("ggpubr", repos="https://cran.rediris.org/")

# Failed because some dependencies cannot be installed from https://cran.rediris.org/
install.packages("ggpubr", repos="https://cran.rediris.org/", dependencies=TRUE)

我真的很困惑。我怎样才能解决这个问题?

更新#1:

按照建议,我使用了

代码语言:javascript
复制
install.packages("ggpubr",
                 repos = "https://cloud.r-project.org/",
                 dependencies = TRUE)

但仍然有以下错误:

代码语言:javascript
复制
2020-06-13T10:16:21.5258238Z [0m[91mERROR: dependencies 'pbkrtest', 'lme4' are not available for package 'car'
2020-06-13T10:16:21.5258733Z [0m[91m* removing '/usr/local/R/library/car'
2020-06-13T10:16:21.8271275Z [0m[91mERROR: dependency 'car' is not available for package 'rstatix'
2020-06-13T10:16:21.8271930Z [0m[91m* removing '/usr/local/R/library/rstatix'
2020-06-13T10:16:22.2094780Z [0m[91mERROR: dependency 'rstatix' is not available for package 'ggpubr'
2020-06-13T10:16:22.2095409Z [0m[91m* removing '/usr/local/R/library/ggpubr'
2020-06-13T10:16:22.2202760Z [0m[91m
2020-06-13T10:16:22.2202943Z The downloaded source packages are in
2020-06-13T10:16:22.2203292Z    '/tmp/RtmpRJqVdH/downloaded_packages'
2020-06-13T10:16:22.2209634Z [0m[91mUpdating HTML index of packages in '.Library'
2020-06-13T10:16:22.2695889Z [0m[91mMaking 'packages.html' ...[0m[91m done
2020-06-13T10:16:22.2696343Z Warning messages:
2020-06-13T10:16:22.2696877Z 1: In install.packages("ggpubr", repos = "https://cloud.r-project.org/",  :
2020-06-13T10:16:22.2697332Z   installation of package 'nloptr' had non-zero exit status
2020-06-13T10:16:22.2697747Z 2: In install.packages("ggpubr", repos = "https://cloud.r-project.org/",  :
2020-06-13T10:16:22.2698158Z   installation of package 'lme4' had non-zero exit status
2020-06-13T10:16:22.2698562Z 3: In install.packages("ggpubr", repos = "https://cloud.r-project.org/",  :
2020-06-13T10:16:22.2698981Z   installation of package 'pbkrtest' had non-zero exit status
2020-06-13T10:16:22.2699408Z 4: In install.packages("ggpubr", repos = "https://cloud.r-project.org/",  :
2020-06-13T10:16:22.2699816Z  [0m[91m installation of package 'car' had non-zero exit status
2020-06-13T10:16:22.2700246Z 5: In install.packages("ggpubr", repos = "https://cloud.r-project.org/",  :
2020-06-13T10:16:22.2700644Z   installation of package 'rstatix' had non-zero exit status
2020-06-13T10:16:22.2701086Z 6: In install.packages("ggpubr", repos = "https://cloud.r-project.org/",  :
2020-06-13T10:16:22.2701483Z   installation of package 'ggpubr' had non-zero exit status
2020-06-13T10:16:22.8005121Z [0m[91malso installing the dependency 'triebeard'

更新#2:

按照注释中的建议,我尝试一个接一个地使用install.packages而不是dependencies=TRUE安装依赖关系。我从安装包nloptr开始。请参见下面的错误消息:ERROR: configuration failed for package 'nloptr'

代码语言:javascript
复制
2020-06-13T11:25:07.6990004Z [91mtestopt.cpp: In function 'int test_function(int)':
2020-06-13T11:25:07.6990942Z testopt.cpp:223:21: warning: 'nlopt_result nlopt_minimize(nlopt_algorithm, int, nlopt_func_old, void*, const double*, const double*, double*, double*, double, double, double, double, const double*, int, double)' is deprecated [-Wdeprecated-declarations]
2020-06-13T11:25:07.6991447Z      maxeval, maxtime);
2020-06-13T11:25:07.6991629Z                      ^
2020-06-13T11:25:07.6991995Z [0m[91mIn file included from testopt.cpp:44:0:
2020-06-13T11:25:07.6992273Z ../api/nlopt.h:329:28: note: declared here
2020-06-13T11:25:07.6992503Z  NLOPT_EXTERN(nlopt_result) nlopt_minimize(
2020-06-13T11:25:07.6992740Z                             ^~~~~~~~~~~~~~
2020-06-13T11:25:07.8309097Z [0mmv -f .deps/testopt.Tpo .deps/testopt.Po
2020-06-13T11:25:07.8351821Z /bin/bash ../libtool  --tag=CXX   --mode=link x86_64-conda_cos6-linux-gnu-c++ -std=gnu++11  -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I/usr/local/envs/mlopspython_ci/include -fdebug-prefix-map=/tmp/build/80754af9/r-base_1570124924484/work=/usr/local/src/conda/r-base-3.6.1 -fdebug-prefix-map=/usr/local/envs/mlopspython_ci=/usr/local/src/conda-prefix   -o testopt testfuncs.o testopt.o ../libnlopt_cxx.la -lm 
2020-06-13T11:25:07.8924933Z [91mlibtool: link: warning: library `/usr/local/envs/mlopspython_ci/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/lib/../lib/libstdc++.la' was moved.
2020-06-13T11:25:07.9019996Z [0m[91mlibtool: link: warning: library `/usr/local/envs/mlopspython_ci/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/lib/../lib/libstdc++.la' was moved.
2020-06-13T11:25:07.9146941Z [0mlibtool: link: x86_64-conda_cos6-linux-gnu-c++ -std=gnu++11 -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I/usr/local/envs/mlopspython_ci/include -fdebug-prefix-map=/tmp/build/80754af9/r-base_1570124924484/work=/usr/local/src/conda/r-base-3.6.1 -fdebug-prefix-map=/usr/local/envs/mlopspython_ci=/usr/local/src/conda-prefix -o .libs/testopt testfuncs.o testopt.o  ../.libs/libnlopt_cxx.so /usr/local/envs/mlopspython_ci/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/lib/../lib/libstdc++.so -lm -Wl,-rpath -Wl,/tmp/RtmpWCPONP/R.INSTALL11b11c1011f6/nloptr/src/nlopt_src/lib -Wl,-rpath -Wl,/usr/local/envs/mlopspython_ci/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/lib/../lib
2020-06-13T11:25:07.9602105Z [91m/usr/local/envs/mlopspython_ci/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin[0m[91m/ld: ../.libs/libnlopt_cxx.so: undefined reference to `memcpy@GLIBC_2.14'
2020-06-13T11:25:07.9602657Z collect2: error: ld returned 1 exit status
2020-06-13T11:25:07.9621958Z [0m[91mmake[2]: *** [Makefile:381: testopt] Error 1
2020-06-13T11:25:07.9622950Z [0mmake[2]: Leaving directory '/tmp/RtmpWCPONP/R.INSTALL11b11c1011f6/nloptr/src/nlopt_src/test'
2020-06-13T11:25:07.9633779Z [91mmake[1]: *** [Makefile:574: all-recursive] Error 1
2020-06-13T11:25:07.9634679Z [0mmake[1]: Leaving directory '/tmp/RtmpWCPONP/R.INSTALL11b11c1011f6/nloptr/src/nlopt_src'
2020-06-13T11:25:07.9635296Z [91mmake: *** [Makefile:438: all] Error 2
2020-06-13T11:25:07.9838980Z [0m[91mERROR: configuration failed for package 'nloptr'
2020-06-13T11:25:07.9845313Z [0m[91m* removing '/usr/local/R/library/nloptr'
EN

回答 7

Stack Overflow用户

发布于 2020-06-13 09:31:40

您可以定义一个能够提供所有包的CRAN镜像。

代码语言:javascript
复制
install.packages("ggpubr", repos = "https://cloud.r-project.org/", dependencies = TRUE)

(至少对我来说是这样的。)

也可以将repos定义为CRAN镜像的向量:

代码语言:javascript
复制
install.packages("ggpubr",
                 repos = c("https://cran.rediris.org/", "https://cloud.r-project.org/"),
                 dependencies = TRUE)
票数 1
EN

Stack Overflow用户

发布于 2021-04-13 11:32:59

我尝试了NMostajo安装sudo apt-get install libcurl4-openssl-dev的答案,因为ggpubr的安装问题似乎是由nloptr的问题引起的。单靠这一点并不能解决问题。在github上,我找到了另一个需要安装提示libnlopt-dev。这个解决了我的问题。

票数 1
EN

Stack Overflow用户

发布于 2022-07-19 23:27:14

我不是R方面的专家,但我不得不安装几个软件包,也不得不在R中安装很少的依赖项。

终端运行

代码语言:javascript
复制
sudo apt-get install libblas-dev liblapack-dev gfortran
rm -r /home/isuru/R/x86_64-pc-linux-gnu-library/4.2/00LOCK-RcppEigen

然后在R中安装软件包

代码语言:javascript
复制
install.packages("pbkrtest")
install.packages("ggpubr")

我还遵循了其他答案中的一些说明。所以不太确定到底需要什么。我在使用Ubuntu20.04LTS。

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

https://stackoverflow.com/questions/62357732

复制
相关文章

相似问题

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