[問題]Mac 安裝package失敗

看板R_Language作者 (itsssll)時間2年前 (2021/07/18 15:10), 編輯推噓3(304)
留言7則, 3人參與, 2年前最新討論串1/1
- 問題: 程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來) [軟體熟悉度]: 使用者(已經有用R 做過不少作品) [問題敘述]: 一直以來我的Mac上的R & R studio都無法安裝任何package 不論是用install.packages()語法或是下載CRAN手動安裝都失敗 google到的所有方法也都是過了(更改global options中的mirror、 terminal 安裝xcode-select --install、安裝clang) 昨天解除安裝再重新下載R studio之後也不行 之前是學生所以就都用學校的電腦 一樣的語法、安裝方式學校的電腦都可以成功 但現在畢業了 只能用自己的電腦所以很需要解決這件事 [程式範例]: > install.packages("tidyverse") 嘗試 URL 'https://archive.linux.duke.edu/cran/bin/macosx/contrib/4.1/tidyverse_1.3.1.tgz' Content type 'application/octet-stream' length 421072 bytes (411 KB) ================================================== downloaded 411 KB The downloaded binary packages are in /var/folders/2q/2png0gyx0z36y_5zp76s8wt80000gn/T//RtmpzgxbSy/downloaded_packages > ###load the tidyverse functions #### Do this everytime you want to use tidyverse commands > library(tidyverse) 錯誤: 套件或命名空間載入失敗 ‘tidyverse’ in dyn.load(file, DLLpath = DLLpath, ...): 無法載入共享物件 '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/stringi/libs/stringi.so' : dlopen(/Library/Frameworks/R.framework/Versions/4.1/Resources/library/stringi/libs/stringi.so, 6): no suitable image found. Did find: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/stringi/libs/stringi.so: mach-o, but wrong architecture /Library/Frameworks/R.framework/Versions/4.1/Resources/library/stringi/libs/stringi.so: mach-o, but wrong architecture [環境敘述]: > sessionInfo() R version 4.1.0 (2021-05-18) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Big Sur 11.1 Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib Random number generation: RNG: Mersenne-Twister Normal: Inversion Sample: Rounding locale: [1] zh_TW.UTF-8/zh_TW.UTF-8/zh_TW.UTF-8/C/zh_TW.UTF-8/zh_TW.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] ggplot2_3.3.5 loaded via a namespace (and not attached): [1] Rcpp_1.0.7 cellranger_1.1.0 pillar_1.6.1 compiler_4.1.0 dbplyr_2.1.1 [6] forcats_0.5.1 tools_4.1.0 jsonlite_1.7.2 lubridate_1.7.10 lifecycle_1.0.0 [11] tibble_3.1.2 gtable_0.3.0 pkgconfig_2.0.3 rlang_0.4.11 reprex_2.0.0 [16] DBI_1.1.1 haven_2.4.1 xml2_1.3.2 withr_2.4.2 dplyr_1.0.7 [21] httr_1.4.2 fs_1.5.0 generics_0.1.0 vctrs_0.3.8 hms_1.1.0 [26] grid_4.1.0 tidyselect_1.1.1 glue_1.4.2 R6_2.5.0 fansi_0.5.0 [31] readxl_1.3.1 readr_1.4.0 modelr_0.1.8 purrr_0.3.4 tidyr_1.1.3 [36] magrittr_2.0.1 scales_1.1.1 backports_1.2.1 ellipsis_0.3.2 rvest_1.0.0 [41] assertthat_0.2.1 colorspace_2.0-2 utf8_1.2.1 munsell_0.5.0 broom_0.7.8 [46] crayon_1.4.1 [關鍵字]: package install 安裝失敗 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 42.76.28.159 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1626592216.A.65A.html

07/19 00:07, 2年前 , 1F
開一個全新的使用者試試看,或是個人r library砍掉再試
07/19 00:07, 1F

07/19 00:07, 2年前 , 2F
試看
07/19 00:07, 2F

07/20 09:49, 2年前 , 3F
既然是Mac進Terminal中的R安裝看看,不行R砍掉重裝
07/20 09:49, 3F

07/20 09:50, 2年前 , 4F
可以試試其他安裝R的方式 比方brew or Anaconda
07/20 09:50, 4F

07/21 06:49, 2年前 , 5F
這個看起來跟底下 MiddleRe 大的問題類似,是 M1 核心?
07/21 06:49, 5F

07/21 06:50, 2年前 , 6F
抱歉沒注意 sessioninfo,有試過從 source compile
07/21 06:50, 6F

07/21 06:50, 2年前 , 7F
stringi 嗎?
07/21 06:50, 7F
文章代碼(AID): #1WyzFOPQ (R_Language)
文章代碼(AID): #1WyzFOPQ (R_Language)