当我想安装包mclust
时,我收到以下错误:
> install.packages("mclust")
Installing package into ‘C:/Users/hp1/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is
later:
binary source needs_compilation
mclust 5.2.3 5.3 TRUE
Do you want to install from sources the package which needs compilation?
y/n: y
installing the source package ‘mclust’
trying URL 'https://cran.rstudio.com/src/contrib/mclust_5.3.tar.gz'
Content type 'application/x-gzip' length 2792962 bytes (2.7 MB)
downloaded 2.7 MB
* installing *source* package 'mclust' ...
** package 'mclust' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
gcc -m32 -I"C:/PROGRA~1/R/R-32~1.3/include" -DNDEBUG -I"d:/RCompile/r-compiling/local/local323/include" -O3 -Wall -std=gnu99 -mtune=core2 -c init.c -o init.o
gfortran -m32 -O3 -mtune=core2 -c mclust.f -o mclust.o
make: gfortran: Command not found
C:/PROGRA~1/R/R-32~1.3/etc/i386/Makeconf:206: recipe for target 'mclust.o' failed
make: *** [mclust.o] Error 127
Warning: running command 'make -f "Makevars" -f "C:/PROGRA~1/R/R-32~1.3/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-32~1.3/share/make/winshlib.mk" SHLIB="mclust.dll" SHLIB_LIBADD='$(FLIBS)' OBJECTS="init.o mclust.o mclustaddson.o"' had status 2
ERROR: compilation failed for package 'mclust'
* removing 'C:/Users/hp1/Documents/R/win-library/3.2/mclust'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\hp1\Documents\R\win-library\3.2" C:\Users\hp1\AppData\Local\Temp\RtmpiAzB7h/downloaded_packages/mclust_5.3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘mclust’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\hp1\AppData\Local\Temp\RtmpiAzB7h\downloaded_packages’
在挖掘解决方案时,我遇到了this,其中OP在评论中说由于缺少llpack
和lblas
库而导致问题出现,他们通过安装lapackdev
和blasdev
软件包来解决问题。但是当我尝试安装这些软件包时,我收到了错误。我检查了所有12个存储库并再次尝试,但结果相同。
> install.packages("lapackdev")
Installing package into ‘C:/Users/hp1/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘lapackdev’ is not available (for R version 3.2.3)
> setRepositories(graphics = getOption("menu.graphics"),
+ ind = NULL, addURLs = character())
--- Please select repositories for use in this session ---
1: + CRAN 2: BioC software
3: BioC annotation 4: BioC experiment
5: BioC extra 6: + CRAN (extras)
7: Omegahat 8: R-Forge
9: rforge.net 10: CRAN (extras, https)
11: R-Forge [https] 12: rforge.net [https]
Enter one or more numbers separated by spaces, or an empty line to cancel
1: 1 2 3 4 5 6 7 8 9 10 11 12
> install.packages("lapackdev")
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.omegahat.org/R/src/contrib:
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES.gz': HTTP status was '400 Bad Request'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES': HTTP status was '400 Bad Request'
Warning in install.packages :
unable to access index for repository https://R-Forge.R-project.org/src/contrib:
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES'
Installing package into ‘C:/Users/hp1/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.omegahat.org/R/src/contrib:
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES.gz': HTTP status was '400 Bad Request'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES': HTTP status was '400 Bad Request'
Warning in install.packages :
unable to access index for repository https://R-Forge.R-project.org/src/contrib:
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES'
Warning in install.packages :
package ‘lapackdev’ is not available (for R version 3.2.3)
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/bin/windows/contrib/3.2/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.omegahat.org/R/bin/windows/contrib/3.2:
cannot open URL 'http://www.omegahat.org/R/bin/windows/contrib/3.2/PACKAGES'
Warning in install.packages :
cannot open URL 'http://www.rforge.net/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.rforge.net/bin/windows/contrib/3.2/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.rforge.net/bin/windows/contrib/3.2:
cannot open URL 'http://www.rforge.net/bin/windows/contrib/3.2/PACKAGES'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '400 Bad Request'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/bin/windows/contrib/3.2/PACKAGES': HTTP status was '400 Bad Request'
Warning in install.packages :
unable to access index for repository https://R-Forge.R-project.org/bin/windows/contrib/3.2:
cannot open URL 'https://R-Forge.R-project.org/bin/windows/contrib/3.2/PACKAGES'
Warning in install.packages :
cannot open URL 'https://www.rforge.net/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'https://www.rforge.net/bin/windows/contrib/3.2/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository https://www.rforge.net/bin/windows/contrib/3.2:
cannot open URL 'https://www.rforge.net/bin/windows/contrib/3.2/PACKAGES'
与blasdev
相同:
> install.packages("blasdev")
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.omegahat.org/R/src/contrib:
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES.gz': HTTP status was '400 Bad Request'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES': HTTP status was '400 Bad Request'
Warning in install.packages :
unable to access index for repository https://R-Forge.R-project.org/src/contrib:
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES'
Installing package into ‘C:/Users/hp1/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.omegahat.org/R/src/contrib:
cannot open URL 'http://www.omegahat.org/R/src/contrib/PACKAGES'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES.gz': HTTP status was '400 Bad Request'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES': HTTP status was '400 Bad Request'
Warning in install.packages :
unable to access index for repository https://R-Forge.R-project.org/src/contrib:
cannot open URL 'https://R-Forge.R-project.org/src/contrib/PACKAGES'
Warning in install.packages :
package ‘blasdev’ is not available (for R version 3.2.3)
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.omegahat.org/R/bin/windows/contrib/3.2/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.omegahat.org/R/bin/windows/contrib/3.2:
cannot open URL 'http://www.omegahat.org/R/bin/windows/contrib/3.2/PACKAGES'
Warning in install.packages :
cannot open URL 'http://www.rforge.net/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'http://www.rforge.net/bin/windows/contrib/3.2/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://www.rforge.net/bin/windows/contrib/3.2:
cannot open URL 'http://www.rforge.net/bin/windows/contrib/3.2/PACKAGES'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '400 Bad Request'
Warning in install.packages :
cannot open URL 'https://R-Forge.R-project.org/bin/windows/contrib/3.2/PACKAGES': HTTP status was '400 Bad Request'
Warning in install.packages :
unable to access index for repository https://R-Forge.R-project.org/bin/windows/contrib/3.2:
cannot open URL 'https://R-Forge.R-project.org/bin/windows/contrib/3.2/PACKAGES'
Warning in install.packages :
cannot open URL 'https://www.rforge.net/bin/windows/contrib/3.2/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
cannot open URL 'https://www.rforge.net/bin/windows/contrib/3.2/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository https://www.rforge.net/bin/windows/contrib/3.2:
cannot open URL 'https://www.rforge.net/bin/windows/contrib/3.2/PACKAGES'
发生了什么以及如何安装mclust
?
答案 0 :(得分:0)
我正在回答我自己的问题,因为以下解决了这个问题(即mclust
已成功安装),而无需安装我在问题中提到的2个软件包。因此,这可能会帮助遇到困难的人安装mclust
。
我将R版本从3.25升级到3.4,将R studio版本从0.9更新到最新版本(写这个答案时为1.0.143),这似乎解决了这个问题。