ubuntu 16.04 上 R 的 install.packages() 错误
Error with install.packages() for R on ubuntu 16.04
我最近在 Ubuntu 16.04 上安装了 R 并尝试安装我需要的软件包:
install.packages('gimme')
依赖项似乎下载正常,但它们的安装是错误弹出的地方。例如,即使安装了 g++,R 似乎也无法使用它:
* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
checking for g++... no
checking for c++... no
checking for gpp... gpp
checking whether the C++ compiler works... no
configure: error: in `/tmp/Rtmpq1Yg7t/R.INSTALLedf3b8432e7/nloptr':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘nloptr’
* removing ‘/usr/local/lib/R/site-library/nloptr’
据我所知,R 似乎无法在我的系统上找到编译器,但我似乎无法找到解决此问题的方法。我在 windows 机器上安装了这个包就好了。
是否有在 Ubuntu 上设置和安装 R 包的经验?
apt-get install --reinstall g++
改变了一切。缺少 --reinstall 标志
我最近在 Ubuntu 16.04 上安装了 R 并尝试安装我需要的软件包:
install.packages('gimme')
依赖项似乎下载正常,但它们的安装是错误弹出的地方。例如,即使安装了 g++,R 似乎也无法使用它:
* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
checking for g++... no
checking for c++... no
checking for gpp... gpp
checking whether the C++ compiler works... no
configure: error: in `/tmp/Rtmpq1Yg7t/R.INSTALLedf3b8432e7/nloptr':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘nloptr’
* removing ‘/usr/local/lib/R/site-library/nloptr’
据我所知,R 似乎无法在我的系统上找到编译器,但我似乎无法找到解决此问题的方法。我在 windows 机器上安装了这个包就好了。
是否有在 Ubuntu 上设置和安装 R 包的经验?
apt-get install --reinstall g++
改变了一切。缺少 --reinstall 标志