Missing files for `magic` library on Windows

后端 未结 3 1591
栀梦
栀梦 2020-12-31 14:11

I need to get mime type for some files on windows, so i\'ve installed python-magic (on 32-bit python 2.7.3).
It depends on unix magic library.<

3条回答
  •  攒了一身酷
    2020-12-31 15:05

    For future google visitors: Another solution is setting the %MAGIC% enviroment variable in the systems setting to point to the magic file, for me it was:

    "c:\Program Files (x86)\GnuWin32\share\misc\magic"
    

    No need to hardcode the path in your program!

提交回复
热议问题