python 에서 magic library 를 사용하려면 다음과 같이 에러가 발생할 수가 있습니다.
Traceback (most recent call last):
File "audioAnalysis.py", line 7, in <module>
import audioFeatureExtraction as aF
File "/Users/imjaegon/programming/voice_unsupervised/pyaudio_analysis/pyAudioAnalysis/audioFeatureExtraction.py", line 17, in <module>
import audioTrainTest as aT
File "/Users/imjaegon/programming/voice_unsupervised/pyaudio_analysis/pyAudioAnalysis/audioTrainTest.py", line 10, in <module>
import audioBasicIO
File "/Users/imjaegon/programming/voice_unsupervised/pyaudio_analysis/pyAudioAnalysis/audioBasicIO.py", line 1, in <module>
import os, glob, eyed3, ntpath, shutil, numpy
File "/Users/imjaegon/.pyenv/versions/2.7.10/lib/python2.7/site-packages/eyed3/__init__.py", line 32, in <module>
from .utils.log import log # noqa: E402
File "/Users/imjaegon/.pyenv/versions/2.7.10/lib/python2.7/site-packages/eyed3/utils/__init__.py", line 27, in <module>
import magic
File "/Users/imjaegon/.pyenv/versions/2.7.10/lib/python2.7/site-packages/magic.py", line 181, in <module>
raise ImportError('failed to find libmagic. Check your installation')
ImportError: failed to find libmagic. Check your installation
https://github.com/ahupp/python-magic#dependencies
위의 링크에 보면 간단한 해결 방법들이 나와있습니다.
저 같은 경우는 macOS를 사용하고, 아래의 두 명령어를 사용해도 해결되지 않았습니다.
pip install magic pip install libmagic
맥에서는 아래와 같은 명령어를 사용하여 해결해줍니다.
brew install libmagic
그러면 이상 없이 진행됩니다.