问题描述
我刚刚启动了一个新的EC2
ubuntu t1.micro
.我安装了R 3.1.2
,当我尝试安装任何模块时,我得到了:
I just launched a new EC2
ubuntu t1.micro
. I installed R 3.1.2
and when I try to install any module I get:
Warning messages:
1: In system2(cmd0, args, env = env, stdout = outfile, stderr = outfile) :
system call failed: Cannot allocate memory
2: In install.packages("zoo") :
installation of package ‘zoo’ had non-zero exit status
我阅读了另一个问题这可能是因为交换内存,但是在我的情况下,该内存设置为60,我认为应该没问题.
I read on another question that this might be because of the swap memory, but in my case the memory is set to 60 which I think should be all right.
当我运行.libsPaths()
时,我会得到
> .libPaths()
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
[3] "/usr/lib/R/library"
起初,R抱怨它没有在/usr/lib/R/library
上进行写操作的权限,但是当我更改目录权限后,该错误消失了.
At first R was complaining that it did not had permission to write on /usr/lib/R/library
, but after I changed the directory permissions that error went away.
任何有关如何使其正常工作的线索将不胜感激.谢谢
Any clue on how to get it to work will be appreciated.Thanks
推荐答案
因此,我测试了在更大(t1.small)实例下执行的操作完全相同,并且工作正常.看来R
在EC2 t1.micro
实例上不能很好地发挥作用.
So I tested doing the exact same under a bigger (t1.small) instance and it worked fine. It looks like R
does not play good with EC2 t1.micro
instances.
这两种类型的实例之间的主要区别在于,尽管t1.micro具有0.6GB的内存,而t1.small具有1.7GB.
The main difference between those 2 types of instances is that while the t1.micro has 0.6GB memory the t1.small has 1.7GB.
无法在t2类型实例下对其进行测试,它们的性能可能会更好.
Couldn't test it under t2 type instances, they might perform better.
这篇关于无法安装模块,无法分配内存错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!