簡體   English   中英

無法再安裝任何 R 包

[英]Can't install any R packages anymore

我使用進行生物數據分析。 我在Mac OS Catalina 10.15.4 我最近將 R 更新到version 3.6.3因為我認為這可以解決我無法安裝特定軟件包的問題: DESeq2 巨大的錯誤 - 在我嘗試排除故障時可能犯的許多錯誤中,我沒有真正了解問題所在。 我現在無法安裝任何軟件包。 當我在互聯網上尋找潛在解決方案的兔子洞時,我更新了我的 Clang 版本。 我也打算升級 ,但我想在盲目嘗試更多之前了解問題的真正含義。

現在我已經降級到R 3.5.3 (我想堅持這個 R 版本)。

Qst:使用 R 3.5.3,如何再次從 CRAN 成功安裝軟件包? 還有來自 Bioconductor 的 DESeq2 包?

錯誤警告如下:

install.packages("readr")
 Warning in install.packages : unable to access index for repository http://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5: cannot open URL 'http://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/PACKAGES' Package which is only available in source form, and may need compilation of C/C++/Fortran: 'readr' Do you want to attempt to install these from sources? (Yes/no/cancel) y installing the source package 'readr' trying URL 'http://cran.rstudio.com/src/contrib/readr_1.3.1.tar.gz' Content type 'application/x-gzip' length 268853 bytes (262 KB) ================================================== downloaded 262 KB * installing *source* package 'readr' ... ** package 'readr' successfully unpacked and MD5 sums checked ** libs clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -I. -Ircon -fPIC -Wall -g -O2 -c Collector.cpp -o Collector.o clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -I. -Ircon -fPIC -Wall -g -O2 -c CollectorGuess.cpp -o CollectorGuess.o clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -I. -Ircon -fPIC -Wall -g -O2 -c Iconv.cpp -o Iconv.o clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -I. -Ircon -fPIC -Wall -g -O2 -c LocaleInfo.cpp -o LocaleInfo.o clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -I. -Ircon -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -I. -Ircon -fPIC -Wall -g -O2 -c Reader.cpp -o Reader.o In file included from Reader.cpp:1: In file included from ./Reader.h:3: In file included from ./Collector.h:5: In file included from ./DateTimeParser.h:6: In file included from ./QiParsers.h:4: In file included from ./boost.h:6: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/interprocess/file_mapping.hpp:15: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config.hpp:57: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/platform/macos.hpp:28: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:655: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/gethostuuid.h:39:17: error: unknown type name 'uuid_t' int gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA); ^ In file included from Reader.cpp:1: In file included from ./Reader.h:3: In file included from ./Collector.h:5: In file included from ./DateTimeParser.h:6: In file included from ./QiParsers.h:4: In file included from ./boost.h:6: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/interprocess/file_mapping.hpp:15: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config.hpp:57: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/platform/macos.hpp:28: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:662:27: error: unknown type name 'uuid_t'; did you mean 'uid_t'? int getsgroups_np(int *, uuid_t); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31: note: 'uid_t' declared here typedef __darwin_uid_t uid_t; ^ In file included from Reader.cpp:1: In file included from ./Reader.h:3: In file included from ./Collector.h:5: In file included from ./DateTimeParser.h:6: In file included from ./QiParsers.h:4: In file included from ./boost.h:6: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/interprocess/file_mapping.hpp:15: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config.hpp:57: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/platform/macos.hpp:28: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:664:27: error: unknown type name 'uuid_t'; did you mean 'uid_t'? int getwgroups_np(int *, uuid_t); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31: note: 'uid_t' declared here typedef __darwin_uid_t uid_t; ^ In file included from Reader.cpp:1: In file included from ./Reader.h:3: In file included from ./Collector.h:5: In file included from ./DateTimeParser.h:6: In file included from ./QiParsers.h:4: In file included from ./boost.h:6: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/interprocess/file_mapping.hpp:15: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config.hpp:57: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/platform/macos.hpp:28: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:727:31: error: unknown type name 'uuid_t'; did you mean 'uid_t'? int setsgroups_np(int, const uuid_t); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31: note: 'uid_t' declared here typedef __darwin_uid_t uid_t; ^ In file included from Reader.cpp:1: In file included from ./Reader.h:3: In file included from ./Collector.h:5: In file included from ./DateTimeParser.h:6: In file included from ./QiParsers.h:4: In file included from ./boost.h:6: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/interprocess/file_mapping.hpp:15: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config.hpp:57: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/platform/macos.hpp:28: In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:729:31: error: unknown type name 'uuid_t'; did you mean 'uid_t'? int setwgroups_np(int, const uuid_t); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31: note: 'uid_t' declared here typedef __darwin_uid_t uid_t; ^ 5 errors generated. make: *** [Reader.o] Error 1 ERROR: compilation failed for package 'readr' * removing '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/readr' Warning in install.packages : installation of package 'readr' had non-zero exit status The downloaded source packages are in '/private/var/folders/49/18qlr0bn7xg_mk2pzxvrb0f80000gn/T/RtmpN5hCja/downloaded_packages'

感謝你的幫助。

我在 Mac 上遇到了同樣的問題! 我正在運行莫哈韋沙漠。 最近似乎 CRAN 出現了問題。 添加以下 repo 參數對我有用:

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

更多信息: https : //community.rstudio.com/t/i-can-t-install-packages-on-r-studio-non-zero-exit-status/52135

我認為問題是 uuid_t 類型沒有在任何地方定義。 因此,例如,文件/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h第 662 行的聲明將導致錯誤。

在第一次嘗試中,我嘗試在 unistd.h 文件中添加一行: #include at line 83 但它沒有幫助。

因為我不想深入編輯很多系統文件,所以我在 unistd.h 中添加了另一行,以根據 _uuid_t.h 中的定義手動定義 uuid_t 的類型。 typedef __darwin_uuid_t uuid_t; 第 661 行,在"#endif" 之后

然后它起作用了。

我不確定這是否是 MacOSX.10.15.sdk 源代碼中的錯誤。 但是,如果您想以這種方式修復它,請確保您在編輯這些文件時具有 root 權限。

我依靠這兩個帖子來解決我的問題:

https://www.nistara.net/post/compile-issues-r/

https://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos/

感謝無衣教授和 Nistara Randhawa

暫無
暫無

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

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