繁体   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