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
I got this error message when I installed nloptr package which need to install mi package.
How can I deal with this nloptr error in R?
2.4k views Asked by Khin Thet Swe At
1
From the path showing up in the error message, it looks like you're running on macOS.
If so, you must install the
nlopt
system library before installingnloptr
.Hopefully you have Homebrew installed (if not, please reply/comment and I will attach some further info), hence open the Terminal and run
At the end of the
brew install
command, go back toR
and installnloptr
.