Python-magic installation error - ImportError: failed to find libmagic

前端 未结 4 1672
天涯浪人
天涯浪人 2020-12-18 03:43

I am trying to install python-magic for Windows and I have followed all the instructions in https://github.com/ahupp/python-magic and repeated the process several times but

相关标签:
4条回答
  • 2020-12-18 03:54

    Go here and download the file "python_magic_bin-0.4.14-py2.py3-none-win32.whl", then

    pip install python_magic_bin-0.4.14-py2.py3-none-win32.whl
    

    now python-magic works

    0 讨论(0)
  • 2020-12-18 04:03

    The below original answer is now outdated. Please simply follow the instructions denoted under the "dependencies" section.


    ORIGINAL ANSWER:

    I was able to solve this problem by moving the 3 files from GNUWin32 project to a separate directory (not the \system32 directory the docs suggest) and adding them to the PATH environment variable

    0 讨论(0)
  • 2020-12-18 04:10

    Installing Cygwin with libmagic libary and installing the most recent version of the module from Github solves this problem.

    At the time this question was asked, https://github.com/ahupp/python-magic probably didn't support cygmagic-1.dll.

    0 讨论(0)
  • 2020-12-18 04:20

    I know this is a Windows question, but i wanted to share a Debian solution:

    apt-get install libmagic-dev
    

    Kind regards.

    0 讨论(0)
提交回复
热议问题