Skip to content

ImportError: failed to find libmagic. Check your installation #61

Closed

Description

@tomek-he-him

I get the above error on Windows 8.1 x64 using either Git Bash, Cygwin or the regular Command Line.

A similar issue has been posted as #12, but the solution there was to install libmagic. I have the package properly installed:

> where file
c:\cygwin64\bin\file.exe

Activity

  1. ahupp commented on Apr 28, 2014

    @ahupp
    Owner

    You might have to tweak the search path that ctypes uses. Look at the library loading logic inside magic.py. Unfortunately I don't have a windows device so I can't help any more than that.

  2. ahupp commented on Apr 28, 2014

    @ahupp
    Owner

    If you fix it feel free to send me a pull request and I can incorporate it.

  3. ahupp commented on Apr 28, 2014

    @ahupp
    Owner

    Does this pull request fix your problem? What is magic.dll named? If it's cymagic-1, this should fix it.

  4. ahupp commented on Apr 28, 2014

    @ahupp
    Owner
  5. tomek-he-him commented on Apr 28, 2014

    @tomek-he-him
    Author

    I managed to solve my problem by installing libmagic from GnuWin32. Thanks anyway - by looking at the code I guess the pull request would do.

  6. Charan29 commented on Jul 11, 2016

    @Charan29

    @ahupp, please suggest me how i can resolve this issue

    import magic
    Traceback (most recent call last):
    File "", line 1, in
    File "C:\Python34\lib\site-packages\mag
    from magic.identify import Magic, Mag
    File "C:\Python34\lib\site-packages\mag
    from magic import api
    File "C:\Python34\lib\site-packages\mag
    raise ImportError('Unable to find mag
    ImportError: Unable to find magic library

    i am using window7 32-bit system and i have download mentioned .dll files and given PATH in environment option.

  7. ahupp commented on Jul 24, 2016

    @ahupp
    Owner

    @Charan29 sorry, i'm not sure how to debug that. I suggest using a tool like procmon to see where it's looking for the DLLs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions