Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
tomek-he-him opened this issue Apr 26, 2014 · 7 comments · May be fixed by #294
Closed

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

tomek-he-him opened this issue Apr 26, 2014 · 7 comments · May be fixed by #294

Comments

@tomek-he-him
Copy link

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
@ahupp
Copy link
Owner

ahupp commented Apr 28, 2014

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.

@ahupp
Copy link
Owner

ahupp commented Apr 28, 2014

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

@ahupp ahupp closed this as completed Apr 28, 2014
@ahupp
Copy link
Owner

ahupp commented Apr 28, 2014

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

@ahupp
Copy link
Owner

ahupp commented Apr 28, 2014

#58

@tomek-he-him
Copy link
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.

@Charan29
Copy link

@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.

@ahupp
Copy link
Owner

ahupp commented Jul 24, 2016

@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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants