簡體   English   中英

首次在Mac上安裝RStudio。 為什么我不能安裝任何軟件包?

[英]Installing RStudio on Mac for the first time. Why can't I install any packages?

在Windows PC上工作多年后,我已經在Mac上成功安裝了RStudio。 不用說,軟件包安裝是我的下一步,但是每當我嘗試安裝軟件包時,都會返回錯誤。 當我嘗試安裝軟件包依賴項時發生錯誤...為了簡化起見,在此示例中,我將使用“ tibble”軟件包。

原諒我的新手編碼性質,我仍然每天學習。

我嘗試安裝不同的程序包(這些程序包全部來自CRAN),每次都出現相同的結果。

編輯:分別輸入“ no”,“ yes”將安裝軟件包。 有人知道為什么我仍然收到此輸出嗎? 不必一次安裝一個軟件包,那就太好了。 謝謝!

> install.packages("tibble")
> y
> y

我希望安裝成功,但是實際輸出如下:

> install.packages("tibble")
also installing the dependencies ‘utf8’, ‘fansi’, ‘pillar’, ‘rlang’


  There are binary versions available but the source versions are later:
       binary source needs_compilation
utf8    1.1.3  1.1.4              TRUE
pillar  1.0.1  1.3.1             FALSE
rlang   0.1.6  0.3.4              TRUE
tibble  1.3.4  2.1.1              TRUE

Do you want to install from sources the packages which need compilation?
y/n: y
Package which is only available in source form, and may need compilation of
  C/C++/Fortran: ‘fansi’
Do you want to attempt to install these from sources?
y/n: y
installing the source packages ‘utf8’, ‘fansi’, ‘pillar’, ‘rlang’, ‘tibble’

trying URL 'https://cran.rstudio.com/src/contrib/utf8_1.1.4.tar.gz'
Content type 'application/x-gzip' length 218882 bytes (213 KB)
==================================================
downloaded 213 KB

trying URL 'https://cran.rstudio.com/src/contrib/fansi_0.4.0.tar.gz'
Content type 'application/x-gzip' length 266123 bytes (259 KB)
==================================================
downloaded 259 KB

trying URL 'https://cran.rstudio.com/src/contrib/pillar_1.3.1.tar.gz'
Content type 'application/x-gzip' length 103972 bytes (101 KB)
==================================================
downloaded 101 KB

trying URL 'https://cran.rstudio.com/src/contrib/rlang_0.3.4.tar.gz'
Content type 'application/x-gzip' length 858992 bytes (838 KB)
==================================================
downloaded 838 KB

trying URL 'https://cran.rstudio.com/src/contrib/tibble_2.1.1.tar.gz'
Content type 'application/x-gzip' length 311836 bytes (304 KB)
==================================================
downloaded 304 KB

Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/New_York'
* installing *source* package ‘utf8’ ...
** package ‘utf8’ successfully unpacked and MD5 sums checked
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘utf8’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/utf8’
Warning in install.packages :
  installation of package ‘utf8’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/New_York'
* installing *source* package ‘fansi’ ...
** package ‘fansi’ successfully unpacked and MD5 sums checked
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘fansi’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/fansi’
Warning in install.packages :
  installation of package ‘fansi’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/New_York'
* installing *source* package ‘rlang’ ...
** package ‘rlang’ successfully unpacked and MD5 sums checked
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘rlang’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rlang’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rlang’
Warning in install.packages :
  installation of package ‘rlang’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/New_York'
ERROR: dependencies ‘fansi’, ‘utf8’ are not available for package ‘pillar’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/pillar’
Warning in install.packages :
  installation of package ‘pillar’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/New_York'
ERROR: dependencies ‘fansi’, ‘pillar’ are not available for package ‘tibble’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/tibble’
Warning in install.packages :
  installation of package ‘tibble’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/sn/zj2b1gqx6wsfs76h5mymrk_r0000gn/T/RtmpqBjXKW/downloaded_packages’

錯誤消息告訴您缺少命令行工具。 它們提供了從源代碼編譯軟件包所需的軟件(例如C和C ++編譯器)。

您可以按照此處所述使用xcode-select --install來安裝它們或者如注釋中所述,在提示您從源代碼進行編譯時選擇“否”。

暫無
暫無

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

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