実現したいこと
M1macでsoundfileをimportしたいです
発生している問題・エラーメッセージ
Homebrewでlibsndfileをインストールし、pip3でSoundFileをインストールできました。
しかし、import sndfile
を実行すると以下のエラーコードが出ます。
terminal
1Traceback (most recent call last): 2 File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/soundfile.py", line 142, in <module> 3 raise OSError('sndfile library not found') 4OSError: sndfile library not found 5 6During handling of the above exception, another exception occurred: 7 8Traceback (most recent call last): 9 File "<pyshell#1>", line 1, in <module> 10 import soundfile 11 File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/soundfile.py", line 162, in <module> 12 _snd = _ffi.dlopen(_os.path.join( 13OSError: cannot load library '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib': dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib, 0x0002): tried: '/Applications/Python 3.10/IDLE3.app/Contents/Frameworks/libsndfile.dylib' (no such file), '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_soundfile_data/libsndfile.dylib' (no such file)
試したこと
libsndfile.dylibは/opt/homebrew/lib
にありました。
https://github.com/bastibe/python-soundfile/issues/310 でM1Macでlibsndfileをインストールすることについて言及していますが、英語で読みづらく、わかりません。
補足情報(FW/ツールのバージョンなど)
macOS Monterey 12.5
MacBook Pro(16インチ、2021)
python3.10.6











回答1件
あなたの回答
tips
プレビュー