Ale*_*Lee 3 installation r package ncdf4
我正在尝试安装一个名为“ncdf4”的 R 软件包。\n我已尝试将其安装在 R-studio 界面的“packages”部分,但也尝试输入install.packages("ncdf4")控制台。
这是我在两种情况下得到的输出:
\n\nInstalling package into \xe2\x80\x98/home/user/R/x86_64-pc-linux-gnu-library/3.6\xe2\x80\x99\n(as \xe2\x80\x98lib\xe2\x80\x99 is unspecified)\ntrying URL \'https://cloud.r-project.org/src/contrib/ncdf4_1.17.tar.gz\'\nContent type \'application/x-gzip\' length 124458 bytes (121 KB)\n==================================================\ndownloaded 121 KB\n\n* installing *source* package \xe2\x80\x98ncdf4\xe2\x80\x99 ...\n** package \xe2\x80\x98ncdf4\xe2\x80\x99 successfully unpacked and MD5 sums checked\n** using staged installation\nconfigure.ac: starting\nchecking for nc-config... no\n-----------------------------------------------------------------------------------\nError, nc-config not found or not executable. This is a script that comes with the\nnetcdf library, version 4.1-beta2 or later, and must be present for configuration\nto succeed.\n\nIf you installed the netcdf library (and nc-config) in a standard location, nc-config\nshould be found automatically. Otherwise, you can specify the full path and name of\nthe nc-config script by passing the --with-nc-config=/full/path/nc-config argument\nflag to the configure script. For example:\n\n./configure --with-nc-config=/sw/dist/netcdf4/bin/nc-config\n\nSpecial note for R users:\n-------------------------\nTo pass the configure flag to R, use something like this:\n\nR CMD INSTALL --configure-args="--with-nc-config=/home/joe/bin/nc-config" ncdf4\n\nwhere you should replace /home/joe/bin etc. with the location where you have\ninstalled the nc-config script that came with the netcdf 4 distribution.\n-----------------------------------------------------------------------------------\nERROR: configuration failed for package \xe2\x80\x98ncdf4\xe2\x80\x99\n* removing \xe2\x80\x98/home/user/R/x86_64-pc-linux-gnu-library/3.6/ncdf4\xe2\x80\x99\nWarning in install.packages :\n installation of package \xe2\x80\x98ncdf4\xe2\x80\x99 had non-zero exit status\n\nThe downloaded source packages are in\n \xe2\x80\x98/tmp/RtmpXcbO2y/downloaded_packages\xe2\x80\x99\nRun Code Online (Sandbox Code Playgroud)\n\n有人能够从我提供的代码中破译出什么问题吗?\n谢谢。
\n小智 6
我正在使用 Ubuntu 20.4 并遇到了同样的问题。
第 1 步:在终端中
sudo apt-get update -y
Run Code Online (Sandbox Code Playgroud)
第2步:在终端中
sudo apt-get install -y libnetcdf-dev
Run Code Online (Sandbox Code Playgroud)
第 3 步:在 RStudio 中
install.packages("ncdf4")
Run Code Online (Sandbox Code Playgroud)
之后ncdf4就安装成功了。
参考: https://zoomadmin.com/HowToInstall/UbuntuPackage/libnetcdf-dev