【发布时间】:2020-01-07 12:22:48
【问题描述】:
我正在尝试安装一个名为“ncdf4”的 R 包。
我尝试将它安装在 R-studio 界面的“包”部分,但也尝试在控制台中输入install.packages("ncdf4")。
这是我在两种情况下得到的输出:
Installing package into ‘/home/user/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/ncdf4_1.17.tar.gz'
Content type 'application/x-gzip' length 124458 bytes (121 KB)
==================================================
downloaded 121 KB
* installing *source* package ‘ncdf4’ ...
** package ‘ncdf4’ successfully unpacked and MD5 sums checked
** using staged installation
configure.ac: starting
checking for nc-config... no
-----------------------------------------------------------------------------------
Error, nc-config not found or not executable. This is a script that comes with the
netcdf library, version 4.1-beta2 or later, and must be present for configuration
to succeed.
If you installed the netcdf library (and nc-config) in a standard location, nc-config
should be found automatically. Otherwise, you can specify the full path and name of
the nc-config script by passing the --with-nc-config=/full/path/nc-config argument
flag to the configure script. For example:
./configure --with-nc-config=/sw/dist/netcdf4/bin/nc-config
Special note for R users:
-------------------------
To pass the configure flag to R, use something like this:
R CMD INSTALL --configure-args="--with-nc-config=/home/joe/bin/nc-config" ncdf4
where you should replace /home/joe/bin etc. with the location where you have
installed the nc-config script that came with the netcdf 4 distribution.
-----------------------------------------------------------------------------------
ERROR: configuration failed for package ‘ncdf4’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/3.6/ncdf4’
Warning in install.packages :
installation of package ‘ncdf4’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpXcbO2y/downloaded_packages’
有人能够从我提供的代码中破译出什么问题吗? 谢谢。
【问题讨论】:
-
那里的错误消息告诉您,您需要安装
netcdf才能安装该 R 包。如何在你的 Linux 机器上安装netcdf将是特定于发行版的。你在跑什么? -
Duckmayr,我正在使用带有 Crostini Linux 的 Chromebook。
-
tall.packages('netcdf4') 安装包到'C:/Users************************/R /win-library/4.1'(因为 'lib' 未指定)---请选择在此会话中使用的 CRAN 镜像 --- 警告消息:包 'netcdf4' 不适用于此版本的 R A 版本此包对于您的 R 版本可能在其他地方可用,请参阅cran.r-project.org/doc/manuals/r-patched/… > 的想法,它是最新的 R 4.1.2
标签: r installation package ncdf4