プログラミング

"This error originates from a subprocess, and is likely not a problem with pip."のエラーが出た

Pythonのライブラリをインストールするときに、下記エラーが出ました。

エラーコード

note: This error originates from a subprocess, and is likely not a problem with pip.
      error: legacy-install-failure
      
      × Encountered error while trying to install package.
      ╰─> numpy
      
      note: This is an issue with the package mentioned above, not pip.
      hint: See above for output from the failure.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies 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.

やろうとしていたこと

pip3 install pandas_gbq

原因

Pythonのバージョンが対応していなかった。

pandas_gbqのサポートは<3.11だったが、3.11のPythonを使用してしまっていた。

対処方法

Pythonのバージョンをダウングレードする。

Pythonをダウングレードさせてしまうのは他にも色々と影響を出してしまう可能性があるので、私はpandas_gbqを使うフォルダ下のみpip envでPythonのバージョンを下げた環境をつくって使用しました。

pipenvのインストールと基本的な使い方

  • この記事を書いた人

たかさん

犬と暮らすクラウドエンジニア。GCPが好きだけど良く触るのはAWSとAzureです。

-プログラミング
-