我正在尝试安装R包 ggpubr
如下(在Docker镜像上)--所有其他库都成功安装。
install.packages("~/mypackages/ggpubr_0.3.0.tar.gz", repos=NULL, type="source")
但我得到以下错误。
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'
我试图以不同的方式安装它。
# 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。
按照建议,我使用了``。
install.packages("ggpubr",
repos = "https://cloud.r-project.org/",
dependencies = TRUE)
但还是出现了以下错误
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'
.
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'
你可以定义一个能够提供所有包的 CRAN 镜像,比如说。
install.packages("ggpubr", repos = "https://cloud.r-project.org/", dependencies = TRUE)
(至少对我来说是这样的。)
或者你可以定义 repos
作为CRAN镜像的向量。
install.packages("ggpubr",
repos = c("https://cran.rediris.org/", "https://cloud.r-project.org/"),
dependencies = TRUE)