簡體   English   中英

如何處理R中的nloptr錯誤?

[英]How can I deal with this nloptr error in R?

init_nloptr.c:35:10: fatal error: 'nlopt.h' file not found
#include "nlopt.h"
         ^~~~~~~~~
1 error generated.
make: *** [init_nloptr.o] Error 1
ERROR: compilation failed for package 'nloptr'
* removing '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/nloptr'
Warning in install.packages :
  installation of package 'nloptr' had non-zero exit status
我在安裝需要安裝mi軟件包的nloptr軟件包時收到此錯誤消息。

從錯誤消息中顯示的路徑來看,好像您在macOS上運行。

如果是這樣,您必須安裝nlopt安裝前的系統庫nloptr

希望您已經安裝了Homebrew(如果未安裝,請回復/評論,我會附加一些信息),因此請打開終端並運行

brew install nlopt

brew install命令的末尾,返回R並安裝nloptr

暫無
暫無

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

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