LoginSignup
28
32

More than 3 years have passed since last update.

pip install hogehogeで" ERROR: Command errored out with exit status 1:"と出た時の解決策メモ

Last updated at Posted at 2020-03-08

Python初心者です。
Pythonの開発環境構築時に pip install コマンドのエラーでつかえたので、
解決策をメモとして残します。

起こったこと

  • テキストファイルにインストールしたいライブラリを列挙し、ローカル環境でpip installをしようとした(下記リンク(1)参照)ところ、wordcloudというライブラリのインストーリング中に以下のエラーが出力された。
C:\Python\Python38 >>  pip install -r requirements.txt
>>
(中略)   
ERROR: Command errored out with exit status 1:
(中略)
ERROR: Command errored out with exit status 1: 'c:\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; 
sys.argv[0] = '"'"'C:\\Users\\わたし\\AppData\\Local\\Temp\\pip-install-dm1mwd6_\\wordcloud\\setup.py'"'"'; 
__file__='"'"'C:\\Users\\わたし\\AppData\\Local\\Temp\\pip-install-dm1mwd6_\\wordcloud\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', 
open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\わたし\AppData\Local\Temp\pip-record-20xrbjk9\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.


  • pip install wordcloud を試しても同じエラー文が吐き出され、状況変わらず

取り組んだこと

  • エラー文がナンノコッチャよくわからなかったので、同様に困っている人がいたのではと調べたところ、やっぱりいた(下記リンク(2)参照)

解決策

  • インストールができなかったライブラリのwheelファイル(.whl)というものを、下記リンク3からダウンロードする
    • Pythonのライブラリが配布される時に用いられるファイルの拡張子だそうです(要確認)
    • 例:wordcloud-1.6.0-cp38-cp38-win_amd64.whl
  • Pythonを管理しているフォルダに移動させる
    • (私の場合、C:\Python\Python38でした)
  • そのフォルダにて、pip install hogehoge.whl を実行してインストールする
  • (今回の私の場合、テキストファイルに記述されていたwordcloudの部分をコメントアウトし、 pip install -r requirements.txt を再度実行して完了した。)

リンク集

28
32
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
28
32