简体   繁体   English

无法在R中安装和加载“ mlrMBO”软件包

[英]Trouble installing and loading “mlrMBO” package in R

So when I install the package, R returns the following error message: 因此,当我安装软件包时,R返回以下错误消息:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘mlrMBO’

But It then says the package has non-zero exit status and is in 但是它随后说该程序包具有非零退出状态,并且处于

‘/private/var/folders/b_/xwf1w6cn769_2gq06fntysxm0000gn/T/RtmpCGAr62/downloaded_packages’

When I load the package library(mlrMBO) It says the package doesn't exist. 当我加载软件包库(mlrMBO)时,它说该软件包不存在。

I've tried many different methods like using this code 我尝试了许多不同的方法,例如使用此代码

install.packages('mlr', repo='http://cran.fiocruz.br/')

Here's a couple of things you could try: 您可以尝试以下几种方法:

  • Make sure you don't have any Umlauts (ö,ä,ü, å) in your path, ie your User-folder, if you're running on windows. 如果您在Windows上运行,请确保您的路径中没有任何Umlauts(ö,ä,ü,å),即您的用户文件夹。

  • Install devtools install.package("devtools) 安装devtools install.package("devtools)

  • clear data in \\AppData\\Local\\Temp\\ 清除\\AppData\\Local\\Temp\\

That package requires compiling C code, for which you have to install the Xcode developer tools. 该软件包需要编译C代码,您必须为其安装Xcode开发人员工具。

Per Housemd's answer at Apple.SE : Per Housemd 在Apple.SE上回答

Open Terminal, and run the following: 打开终端,然后运行以下命令:

 xcode-select --install 

This will download and install xcode developer tools and fix the problem. 这将下载并安装xcode开发人员工具并解决该问题。 The problem is that one needs to explicitly agree to the license agreement. 问题在于,需要明确同意许可协议。

I found the solution in this question, Command Line Tools not working. 我在此问题中找到了解决方案,命令行工具不起作用。

Once you've done that, run install.packages again. 完成此操作后,再次运行install.packages

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM