https://qiita.com/yura/items/e5c6e9527215e0e0524a
このサイトの
$ pip install synthesizer
を実行するためにpip3を入れて実行しようとしたらエラーが発生し,エラーで調べてみても直せるようなサイトが見当たらなかったので対処法を教えていただきたいです.
以下に行った手順を載せます.
環境はM1 MacBook Air macOSです.
手順
まず,Python3をインストールしました.
MacBook-Air ~ % brew install python3
次に以下のようにしてpip3を取ってきました.
MacBook-Air ~ % curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2500k 100 2500k 0 0 5982k 0 --:--:-- --:--:-- --:--:-- 5968k MacBook-Air ~ % python3 get-pip.py Defaulting to user installation because normal site-packages is not writeable Collecting pip Downloading pip-22.2.2-py3-none-any.whl (2.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 1.7 MB/s eta 0:00:00 Installing collected packages: pip WARNING: The scripts pip, pip3 and pip3.8 are installed in '/Users/usrname/Library/Python/3.8/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed pip-22.2.2 [notice] A new release of pip available: 20.2.3 -> 22.2.2 [notice] To update, run: /Library/Developer/CommandLineTools/usr/bin/python3 -m pip install --upgrade pip
/Library/Developer/CommandLineTools/usr/bin を見るとしっかりpip3はありました.(追記参照)
なのでPATHを通すために.zshrcに
export PATH=$PATH:/Library/Developer/CommandLineTools/usr/bin
を書き込み.
MacBook-Air ~ % pip3 -V pip 22.2.2 from /Users/usrname/Library/Python/3.8/lib/python/site-packages/pip (python 3.8)
ここまではできました.
しかしこの後に
$ pip3 install synthesizer
を実行すると次のようにエラーが出てしまいました.
長いので中間部分のエラーと書いてない部分は省いています.
MacBook-Air ~ % pip3 install synthesizer Defaulting to user installation because normal site-packages is not writeable Collecting synthesizer Downloading synthesizer-0.2.0.tar.gz (5.4 kB) Preparing metadata (setup.py) ... done Collecting enum34>=1.1.6 Downloading enum34-1.1.10-py3-none-any.whl (11 kB) Collecting numpy>=1.13.3 Downloading numpy-1.23.3-cp38-cp38-macosx_11_0_arm64.whl (13.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.3/13.3 MB 7.1 MB/s eta 0:00:00 Collecting scipy>=0.19.1 Downloading scipy-1.9.1.tar.gz (42.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.0/42.0 MB 5.2 MB/s eta 0:00:00 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 ╰─> [61 lines of output] The Meson build system Version: 0.62.2 Source dir: /private/var/folders/d9/bmytbwsn2yjdxh_zrh3b9z380000gn/T/pip-install-rjf8ipbr/scipy_4091f25fb7524e049fd97eb02a3c8294 Build dir: . . . 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.
追記
pipをインストールした際の出力の見る場所を誤っていて,PATHの追加場所が異なっていたようですが,出力されている,
/Users/usrname/Library/Python/3.8/bin
に変更してみても同様のエラーが生じました.
MacBook-Air ~ % which -a python3 /opt/homebrew/bin/python3 /usr/bin/python3
のようにpython3があるようです.
追記2
exportの大文字と小文字の認識が間違っていたようで,今までのものはsource .zshrcが適用できていなかったことで起こったことのようです.
sourceをした後にもう一度
pip3 install synthesizer
をするとエラーの内容が変わりました.(pip install synthesizerとしたときは先ほどと同じエラー)
~ % pip3 install synthesizer Collecting synthesizer Using cached synthesizer-0.2.0.tar.gz (5.4 kB) Preparing metadata (setup.py) ... done Collecting enum34>=1.1.6 Using cached enum34-1.1.10-py3-none-any.whl (11 kB) Collecting numpy>=1.13.3 Downloading numpy-1.23.3-cp310-cp310-macosx_11_0_arm64.whl (13.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.3/13.3 MB 8.7 MB/s eta 0:00:00 Collecting scipy>=0.19.1 Using cached scipy-1.9.1.tar.gz (42.0 MB) Installing build dependencies ... done Getting requirements to build wheel ... done ERROR: Exception: . . . ModuleNotFoundError: No module named 'mesonpy'
簡単に調べてみたところ,Measonというビルド自動化のためのソフトがあるらしいのですが,それをinstallしなくてはいけないということでしょうか.
MacBook-Air ~ % pip3 -V pip 22.2.2 from /opt/homebrew/lib/python3.10/site-packages/pip (python 3.10)
も変わっていました.python3.8でなく3.10になってます.
回答1件
あなたの回答
tips
プレビュー