I want to use Python-Magic
library, but I get:
magic.magic.MagicException: b'could not find any valid magic files!'
Error on a simple code like this:
filepath = 'path\\somefile.txt'
print(magic.from_file(filepath))
I did google the error message and I tried this; as mentioned Missing files for `magic` library on Windows
magic_object = magic.Magic(magic_file = 'C:\\Program Files (x86)\\GnuWin32\\share\\misc\\magic')
This time I get this error:
magic.magic.MagicException: b"File 5.32 supports only version 14 magic files. `C:\Program Files (x86)\GnuWin32\share\misc\magic.mgc' is version 7"
I also did this; Python Error : File 5.3 supports only version 7 magic file nothing changes.
Also I tried changing environment variableMAGIC=path\to\gnuwin32\share\misc\magic
and downloading http://gnuwin32.sourceforge.net/packages/file.htm and nothing changes.
Thanks in advance,