擅长:python、mysql、java
<p>按照@sogu接受的答案中的建议,分配更多的RAM可能会花费您的钱</p>
<p>您也可以通过分配交换空间来免费解决此问题<a href="https://paulshipley.id.au/blog/coding-tips/add-swap-space-to-amazon-lightsail/" rel="nofollow noreferrer">This blog post</a>提供了几个简单的命令来分配1G的交换空间,在我的例子中,这足以让conda安装大多数软件包:</p>
<pre class="lang-sh prettyprint-override"><code>sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
</code></pre>