我在带有 R 的 Windows 10 上工作。由于我的项目计算量很大,我想使用我大学的 Linux 服务器来进行计算。软件包的安装(如果单独尝试,还有它的依赖项)不起作用。
安装其他包工作正常。所以我尝试在控制台上安装我的包但没有用,然后我在控制台中访问 R 并尝试安装它但没有用。接下来,我将我的库从我的 PC 复制到我的 R 在 Linux 服务器上访问的库中。虽然它在我的 PC 上运行良好,但服务器告诉我它找不到我的包裹。
我使用通常的install.packages("prodest")
,我也尝试过类似install.packages("prodest", dependencies = T)
,或者安装它直接需要的依赖项 [如 install.packages("haven")
]。
我想安装它然后在服务器上运行我的脚本。一些进一步的信息:
Warning message on the Server:
compilation terminated.
/usr/lib64/R/etc/Makeconf:167: recipe for target 'readstat/spss/readstat_zsav_compress.o' failed
make: *** [readstat/spss/readstat_zsav_compress.o] Error 1
ERROR: compilation failed for package ‘haven’
* removing ‘/home/rid52xb/R/x86_64-suse-linux-gnu-library/3.6/haven’
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
** using staged installation
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
* rpm: libcurl-devel (Fedora, CentOS, RHEL)
* csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/home/rid52xb/R/x86_64-suse-linux-gnu-library/3.6/curl’
ERROR: dependencies ‘haven’, ‘curl’ are not available for package ‘rio’
* removing ‘/home/rid52xb/R/x86_64-suse-linux-gnu-library/3.6/rio’
ERROR: dependency ‘rio’ is not available for package ‘car’
* removing ‘/home/rid52xb/R/x86_64-suse-linux-gnu-library/3.6/car’
ERROR: dependency ‘car’ is not available for package ‘AER’
* removing ‘/home/rid52xb/R/x86_64-suse-linux-gnu-library/3.6/AER’
ERROR: dependency ‘AER’ is not available for package ‘prodest’
* removing ‘/home/rid52xb/R/x86_64-suse-linux-gnu-library/3.6/prodest’
The downloaded source packages are in
‘/tmp/RtmpGxZbcG/downloaded_packages’
1: In install.packages("prodest") :
installation of package ‘haven’ had non-zero exit status
2: In install.packages("prodest") :
installation of package ‘curl’ had non-zero exit status
3: In install.packages("prodest") :
installation of package ‘rio’ had non-zero exit status
4: In install.packages("prodest") :
installation of package ‘car’ had non-zero exit status
5: In install.packages("prodest") :
installation of package ‘AER’ had non-zero exit status
6: In install.packages("prodest") :
installation of package ‘prodest’ had non-zero exit status
服务器上的 session 信息:
R version 3.6.0 (2019-04-26)
Platform: x86_64-suse-linux-gnu (64-bit)
Running under: SUSE Linux Enterprise Server 12 SP4
Matrix products: default
BLAS: /usr/lib64/R/lib/libRblas.so
LAPACK: /usr/lib64/R/lib/libRlapack.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] data.table_1.12.2
loaded via a namespace (and not attached):
[1] compiler_3.6.0 tools_3.6.0
我电脑上的 session 信息:
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252
[4] LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] prodest_1.0.1 Matrix_1.2-17 dplyr_0.8.3 data.table_1.12.2
loaded via a namespace (and not attached):
[1] zip_2.0.3 Rcpp_1.0.2 cellranger_1.1.0 pillar_1.4.2 compiler_3.6.1
[6] forcats_0.4.0 tools_3.6.1 zeallot_0.1.0 tibble_2.1.3 lattice_0.20-38
[11] pkgconfig_2.0.2 rlang_0.4.0 openxlsx_4.1.0.1 curl_4.0 DEoptim_2.2-4
[16] haven_2.1.1 rio_0.5.16 AER_1.2-7 vctrs_0.2.0 hms_0.5.0
[21] lmtest_0.9-37 grid_3.6.1 tidyselect_0.2.5 glue_1.3.1 R6_2.4.0
[26] survival_2.44-1.1 readxl_1.3.1 foreign_0.8-71 Rsolnp_1.16 carData_3.0-2
[31] Formula_1.2-3 purrr_0.3.2 car_3.0-3 magrittr_1.5 splines_3.6.1
[36] backports_1.1.4 abind_1.4-5 assertthat_0.2.1 sandwich_2.5-1 truncnorm_1.0-8
[41] crayon_1.3.4 zoo_1.8-6
最佳答案
您可能需要在 SUSE Linux 服务器上安装(或让您的管理员安装)libcurl。在 Ubuntu(你的大学服务器没有)上你可以这样做:
sudo apt-get -y install libcurl4-openssl-dev
但在 SUSE 上,我了解到 Yast 可能是更典型的包管理选择。
在获得系统依赖关系后,您仍然需要处理 R 中的依赖关系,因此考虑一下(警告可能需要很长时间):
install.packages( c(tools::package_dependencies(package="prodest", recursive=TRUE)$prodest,
"prodest")
)
不幸的是 install.packages
在搜索依赖树时不是递归的,即依赖项的依赖项的依赖项等.....也就是说,依赖项的数量特定的递归组装树是 77,简单地安装四个或五个丢失的命名包可能会更快。
install.packages( c( 'haven' 'curl' , 'rio, 'car', 'AER'), dependencies=TRUE)
关于r - 包的安装具有非零退出状态 - Linux 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57645696/