簡體   English   中英

無法安裝任何 R 包“無法訪問存儲庫的索引”

[英]Unable to install any R packages "unable to access index for repository"

我已經嘗試了在 stackoverflow 上看到的主要修復,但沒有運氣:

  • 關閉“使用安全下載方法
  • 將主 CRAN 存儲庫更改為全局
  • 卸載/重新安裝 R
    Warning in install.packages :
      unable to access index for repository http://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6:
      cannot open URL "http://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES"

有任何想法嗎? 這一切都是在嘗試安裝 pdftools(它本身與 pkgconfig 有問題)之后開始的。

編輯:這是完整的代碼塊。 它設法從源代碼下載,但隨后給出了零退出狀態

install.packages("ggplot2")
Installing package into ‘/Users/jackshaw/Library/R/3.6/library’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.6:
  cannot open URL 'https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
installing the source package ‘ggplot2’

trying URL 'https://cloud.r-project.org/src/contrib/ggplot2_3.3.0.tar.gz'
Content type 'application/x-gzip' length 3031461 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

[1] "R PROFILE LOADED"

The downloaded source packages are in
    ‘/private/var/folders/c1/5c3yn_tx2fq7nrcjs_kn637r0000gn/T/RtmpjcV10X/downloaded_packages’
Warning message:
In install.packages("ggplot2") :
  installation of package ‘ggplot2’ had non-zero exit status

如果您在 Mac/OS 上工作,您可能需要使用以下命令重定向您的存儲庫:

install.packages("dplyr", repo = 'https://mac.R-project.org')

最近 CRAN 出現了一個小故障: https ://community.rstudio.com/t/i-can-t-install-packages-on-r-studio-non-zero-exit-status/52135

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM