Trouble installing nloptr package on R 3.3.0

老子叫甜甜 提交于 2019-12-05 13:42:46

I tried to reinstall the package as a root and it worked! I don't know why.

I was able to solve the problem on my Mac using

$ brew install nlopt

Looking into the issue I noticed that others had reportedly resolved the issue on Ubuntu using

$ sudo apt-get install libnlopt-dev

Apparently you now need to install it outside of R.

I had to reinstall R, using the R-CRAN installer and uninstalling the macports package.

It finally worked!

If you run into this problem with nloptr 1.2.0 and R 3.5.1 on macOS High Sierra, brew install nlopt will fail because of inadequate permissions in /usr/local. The fix:

$ mkdir /usr/local/Frameworks
$ sudo chown -R $(whoami) /usr/local/Frameworks
$ brew install nlopt

In other words, you don't want to change permissions for the entire /usr/local directory. The installation fails when the Homebrew tries to create /usr/local/Framework. So, do it by hand as shown above. Then try again > install.packages("nloptr"). It worked for me.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!