Ubuntu に lxml をインストールするとコンパイル エラーが発生する

Ubuntu に lxml をインストール中にコンパイラ エラーが観察されました。エラーは次のようになります: エラー: コマンド 'x86_64-linux-gnu-gcc' が終了ステータス 4 で失敗しました。これはメモリ不足が原因である可能性が高いです。

Solutions

  • Enlarge memory if possible, for example, if the issue was encountered on a virtual machine

  • If enlarging memory is not possible, then add swap file:

sudo dd if=/dev/zero of=/swapfile bs=1024 count=524288
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

See reference.

ubuntu python