我正在嘗試安裝上面提到的軟體包,但我無法安裝。我已經遵循了幾個提示,即使這樣也無法安裝上面的軟體包。即使遵循以下已與某些軟體包一起使用的命令,也無法安裝:
install.packages("forecast", INSTALL_opts = "--no-lock")
install.packages("tseries", dependencies = T)
當我嘗試第一個選項時,結果是這樣的:
Installing package into ‘/home/vitor/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependency ‘quadprog’
tentando a URL 'https://cloud.r-project.org/src/contrib/quadprog_1.5-8.tar.gz'
Content type 'application/x-gzip' length 36141 bytes (35 KB)
==================================================
downloaded 35 KB
tentando a URL 'https://cloud.r-project.org/src/contrib/tseries_0.10-49.tar.gz'
Content type 'application/x-gzip' length 170539 bytes (166 KB)
==================================================
downloaded 166 KB
* installing *source* package ‘quadprog’ ...
** package ‘quadprog’ successfully unpacked and MD5 sums checked
staged installation is only possible with locking
** using non-staged installation
** libs
gfortran -fno-optimize-sibling-calls -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-Do_dS_/r-base-4.0.0=. -fstack-protector-strong -msse2 -mfpmath=sse -fpic -g -O2 -fdebug-prefix-map=/build/r-base-Do_dS_/r-base-4.0.0=. -fstack-protector-strong -c aind.f -o aind.o
/bin/bash: gfortran: comando n?o encontrado
make: *** [/usr/lib/R/etc/Makeconf:190: aind.o] Erro 127
ERROR: compilation failed for package ‘quadprog’
* removing ‘/home/vitor/R/x86_64-pc-linux-gnu-library/4.0/quadprog’
Warning in install.packages :
installation of package ‘quadprog’ had non-zero exit status
ERROR: dependency ‘quadprog’ is not available for package ‘tseries’
* removing ‘/home/vitor/R/x86_64-pc-linux-gnu-library/4.0/tseries’
Warning in install.packages :
installation of package ‘tseries’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmpb9K2Gk/downloaded_packages’
A segunda op??o apresenta o seguinte resultado:
Installing package into ‘/home/vitor/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependency ‘quadprog’
tentando a URL 'https://cloud.r-project.org/src/contrib/quadprog_1.5-8.tar.gz'
Content type 'application/x-gzip' length 36141 bytes (35 KB)
==================================================
downloaded 35 KB
tentando a URL 'https://cloud.r-project.org/src/contrib/tseries_0.10-49.tar.gz'
Content type 'application/x-gzip' length 170539 bytes (166 KB)
==================================================
downloaded 166 KB
* installing *source* package ‘quadprog’ ...
** package ‘quadprog’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fno-optimize-sibling-calls -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-Do_dS_/r-base-4.0.0=. -fstack-protector-strong -msse2 -mfpmath=sse -fpic -g -O2 -fdebug-prefix-map=/build/r-base-Do_dS_/r-base-4.0.0=. -fstack-protector-strong -c aind.f -o aind.o
/bin/bash: gfortran: comando n?o encontrado
make: *** [/usr/lib/R/etc/Makeconf:190: aind.o] Erro 127
ERROR: compilation failed for package ‘quadprog’
* removing ‘/home/vitor/R/x86_64-pc-linux-gnu-library/4.0/quadprog’
Warning in install.packages :
installation of package ‘quadprog’ had non-zero exit status
ERROR: dependency ‘quadprog’ is not available for package ‘tseries’
* removing ‘/home/vitor/R/x86_64-pc-linux-gnu-library/4.0/tseries’
Warning in install.packages :
installation of package ‘tseries’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmpb9K2Gk/downloaded_packages’
如何正確進行?
uj5u.com熱心網友回復:
"gfortran: comando n?o encontrado": 缺少 gfortran 編譯器。
在 Linux 上,R 從源代碼構建包。因此,您需要 gcc 工具鏈。要獲得最低限度,您可以這樣做:
sudo apt install build-essential gfortran
一些 R 包也需要其他 Linux 包。tidyverse例如,如果您嘗試安裝,我相信您也需要libicu-dev libbz2-dev libxml2-dev libcurl4-openssl-dev libssl-dev。通常,要找出缺少哪個 Linux 軟體包,您需要破譯編譯錯誤訊息,并可能查看源代碼或網路以獲取更多資訊。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/420152.html
標籤:
