无法在 R 中安装 tseries 和 forecast 包
Cannot install tseries and forecast packages in R
我正在尝试安装上述软件包,但无法安装。我遵循了几个提示,即使这样也无法安装上面的软件包。即使遵循以下已经适用于某些软件包的命令,也无法安装:
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’
第二个结果:
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’
如何正确进行?
"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 包,您需要破译编译错误消息,并可能检查源代码或网络以获取更多信息。
我正在尝试安装上述软件包,但无法安装。我遵循了几个提示,即使这样也无法安装上面的软件包。即使遵循以下已经适用于某些软件包的命令,也无法安装:
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’
第二个结果:
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’
如何正确进行?
"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 包,您需要破译编译错误消息,并可能检查源代码或网络以获取更多信息。