【pip】ライブラリのインストール時に「note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error」でインストールに失敗する場合の対処法[Python]

  • URLをコピーしました!

pip

前回、raytracingライブラリをより便利にする自作関数について紹介しました。

今回はOpticspyという光学設計用のライブラリをインストールしようとした際に出てきた`「error: subprocess-exited-with-error」というエラーへの対処法を紹介していきます。

ちなみにタイトルにある様に「note: This error originates from a subprocess, and is likely not a problem with pip.」という注意書きもあり、「pipの問題ではないようで、subprocessから発生した問題である」ということも問題をややこしくしていました。

対処法

まずこの問題が発生した時の状況はこんな感じでした。

pip install opticspy

実行結果
Collecting opticspy
  Using cached opticspy-0.2.1.tar.gz (1.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.9.3 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from opticspy) (1.26.4)
Requirement already satisfied: matplotlib>=1.4.3 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from opticspy) (3.9.2)
Collecting unwrap (from opticspy)
  Using cached unwrap-0.1.1.tar.gz (18 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [2 lines of output]
      Error: CFFI (required for setup) is not available.
      Please use "pip install cffi", or equivalent.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

とこんな感じでOpticspyのインストールに失敗しました。

このエラーに対処するには「pip」、「setuptools」、「wheel」のライブラリを最新にするのがいい様です。

ということでまずは「pip」のアップグレード。

pip install --upgrade pip

そして「setuptools」と「wheel」のインストール。

pip install setuptools wheel

これで今回の問題は解決しました。

また色々と調べてみると「wheel」だけインストールすればよかった人や「setuptools」、「wheel」のアップグレードで解決した人などもいました。

pip install wheel
pip istall --upgrade setuptools wheel

とりあえずここら辺を抑えておけば問題を解決できる様です。

次回は無限大「inf」の作成方法と特徴を紹介します。

ではでは今回はこんな感じで。

よかったらシェアしてね!
  • URLをコピーしました!

コメント

コメントする

目次
  1. pip
  2. 対処法