Install python-magic and libmagic
masterpython-magic is a Python interface to the libmagic file type identification library. You must install both the Python package and the underlying libmagic C library.
- Install the Python package:
pip install python-magic- Install the
libmagicC library based on your OS:
- Debian/Ubuntu:
sudo apt-get install libmagic1
- **OSX (Homebrew)**:
```bash
brew install libmagic- OSX (MacPorts):
port install file
- **SmartOS**:
Install `libmagic` from source and set `LD_LIBRARY_PATH` to `<prefix>/lib`.
pip install python-magic