LoginSignup
1
1

More than 3 years have passed since last update.

Anacondaのインストールに失敗しMinicondaを入れた話

Posted at

対象読者

Amazon Linux 2へのAnacondaに失敗し、後述のエラー[7149] Failed to execute script entry_pointが得られて困っている人。

image.png

結論

エラーの原因はディスク容量が足りないことかもしません。
MinicondaおよびJupyterlabをインストールするには1GB以上の空き容量を確保しましょう。

環境

  • Amazon Linux 2
エラー本文
Anaconda3 will now be installed into this location:
/home/ec2-user/anaconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/home/ec2-user/anaconda3] >>> 
PREFIX=/home/ec2-user/anaconda3
Unpacking payload ...
concurrent.futures.process._RemoteTraceback:                                                                                    
'''
Traceback (most recent call last):
  File "concurrent/futures/process.py", line 368, in _queue_management_worker
  File "multiprocessing/connection.py", line 251, in recv
TypeError: __init__() missing 1 required positional argument: 'msg'
'''

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "entry_point.py", line 69, in <module>
  File "concurrent/futures/process.py", line 484, in _chain_from_iterable_of_lists
  File "concurrent/futures/_base.py", line 611, in result_iterator
  File "concurrent/futures/_base.py", line 439, in result
  File "concurrent/futures/_base.py", line 388, in __get_result
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
[7149] Failed to execute script entry_point

インストールの流れ

インストーラのダウンロード

公式サイトより、CPUのインストラクションセットに合わせてx86_64のインストーラをダウンロードします。

インストラクションセットは以下のコマンドで確認します。

$ uname -a
Linux ip-10-0-0-33.ap-northeast-1.compute.internal 4.14.203-156.332.amzn2.x86_64 #1 SMP Fri Oct 30 19:19:33 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

image.png

インストーラ実行

以下のコマンド実行によって、記事冒頭に示したエラーが出力されました。

$ sudo chmod +x ./Anaconda3-2020.11-Linux-x86_64.sh
$ ./Anaconda3-2020.11-Linux-x86_64.sh

もう一度、念のため上書きオプションをつけてインストーラを再度実行してみました。

$ ./Anaconda3-2020.11-Linux-x86_64.sh -u

初回インストール時とは異なるエラーが出てきました。
どうやらディスクにスペースがなかったらしいです。

[/home/ec2-user/anaconda3] >>> 
PREFIX=/home/ec2-user/anaconda3
Unpacking payload ...
Failed to write all bytes for certifi/cacert.pem
fwrite: No space left on device
Crypto/Cipher/_raw_blowfish.cpython-38-x86_64-linux-gnu.so could not be extracted!
fopen: No space left on device

原因であったディスクスペース不足の調査

df -hコマンドで確認してみると、このサーバにはそもそも8GBしかディスク容量が用意されていませんでした。。
その8GBを100%使い切ってしまっている状況でした。

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      8.0G  8.0G   20K 100% /

sudo du -sh ./* | lessにてルートディレクトリのどこで容量を埋め尽くしているか確認しました。
掘り下げていくと、Anaconda自体のサイズが2.3GBであったため、8GBしかディスクサイズがないこの環境で利用するのは無謀と判断しました。

Anacondaを一度削除して、Minicondaを入れなおしてみるとインストールに成功しました。
※容量が小さいのでインストーラは即削除しました。

sudo rm -rf ~/anaconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
sudo chmod +x ./Miniconda3-latest-Linux-x86_64.sh
sudo ./Miniconda3-latest-Linux-x86_64.sh
sudo rm ./Miniconda3-latest-Linux-x86_64.sh

無事、Minicondaのインストールが完了しました。
さあ、残り2.5GBでJupyterlabまで使えるようになるのか...!?

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      8.0G  5.6G  2.5G  70% /

conda install -c conda-forge jupyterlabにてじjupyterlabをインストール。
MJupyterlabのインストールのディスク容量消費は0.6GB程度だったので、何とかなりました。

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      8.0G  6.2G  1.9G  78% /

最終的にMinicondaとJupyterlabを合わせて1GB程度のディスク消費で収まり、無事目的は達成されました。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1