使用macOS

时间:2018-09-18 16:06:29

标签: r installation package

我想安装R 3.4.4版本的Rmosek软件包。 我有这个问题:

* installing *source* package ‘Rmosek’ ...
** package ‘Rmosek’ successfully unpacked and MD5 sums checked
Configuring for a UNIX-alike platform (sub-architecture: "")
Found package 'Matrix' version 1.2.14
*** No variable 'PKG_MOSEKHOME' in environment - see configure-vars (configure.vars) argument ***
*** No variable 'PKG_MOSEKHOME' in ./src/setup/Localsys.txt file ***
*** Shell command 'mosek' was not recognized - please validate your installation of MOSEK ***
***   >> PATH = /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Library/TeX/texbin:/opt/X11/bin:/opt/local/bin  ***
ERROR: configuration failed for package ‘Rmosek’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rmosek’
Warning in install.packages :
  installation of package ‘Rmosek’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/42/p9yl3yln6zn8dq_3zdd496kr0000gn/T/RtmpBe0vs2/downloaded_packages’

1 个答案:

答案 0 :(得分:1)

我通过以下帖子解决了我的问题:https://gist.github.com/mikelove/67ea44d5be5a053e599257fe357483dc#file-rmosek-L19

1)从此处下载mosek: https://www.mosek.com/downloads/ (我已将其下载到我的〜/ bin中)

cd〜/ bin tar -xvf mosektoolslinux64x86.tar.bz2

2)将此添加到您的〜/ .bashrc 导出PATH = $ PATH:/ home / username / bin / mosek / 8 / tools / platform / linux64x86 / bin

3)获得学术许可证: https://www.mosek.com/products/academic-licenses/ 检查电子邮件,将许可证文件放入〜/ mosek

4)安装:

导出PKG_MOSEKHOME = / home / username / bin / mosek / 8 / tools / platform / linux64x86 导出PKG_MOSEKLIB = mosek64

然后在R中: install.packages(“ Rmosek”,type =“ source”,INSTALL_opts =“-no-multiarch”,repos =“ http://download.mosek.com/R/8”)