Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Closed
IgnatiusEzeani opened this issue Aug 24, 2022 · 9 comments · May be fixed by #294
Closed

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

IgnatiusEzeani opened this issue Aug 24, 2022 · 9 comments · May be fixed by #294

Comments

@IgnatiusEzeani
Copy link

My installation could not find libmagic. Any suggestions?

@ahupp
Copy link
Owner

ahupp commented Aug 25, 2022

Could you share more information; platform, how you installed it, the error you're seeing, what you've tried to debug already?

@wmazur-splunk
Copy link

This PR may help :-) #279
In my case it occurred it's an issue with Apple M1 Silicone (I do not know how to fix it yet)

"mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))"

@0xDAV1D-1
Copy link

I ran into this problem on a Apple M1 as at least one other person above did. To fix it, I installed homebrew (https://brew.sh/) and then ran brew install libmagic

After that I was able to successfully import magic for my programs that needed them.

@alejandroacho
Copy link

But does it has any sense when you are running it into a docker container?

In my case I'm also working with a M1 macbook, but everything is containerized

@melyux
Copy link

melyux commented Feb 5, 2023

Having this problem inside a Linux container on a Linux machine. Also had it on a Mac. Check out this issue for hundreds of people with this problem using another project that uses this project:

Yelp/elastalert#1927

@francisbrito
Copy link

In case you're Anaconda using as your environment manager:

The command to install libmagic is:

conda install libmagic

@kennethleungty
Copy link

How to fix this for Windows and with pip?

@KaczuH
Copy link

KaczuH commented May 3, 2023

This PR may help :-) #279 In my case it occurred it's an issue with Apple M1 Silicone (I do not know how to fix it yet)

"mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))"

My coworker has the same issue (running on M1 Mac).
Suprisingly i had no problems despite having M1 Mac myself.

What we think differs between our setups is that my colleague installed python via homebrew and i'm using pyenv,

FInally we've been able to force it to work after following instructions in:
https://medium.com/mkdir-awesome/how-to-install-x86-64-homebrew-packages-on-apple-m1-macbook-54ba295230f

But does feel like workaround not proper solution

@ahupp
PR #279 really could have saved us a lot of debugging.

@ahupp
Copy link
Owner

ahupp commented Aug 25, 2023

@KaczuH yeah swallowing was a bad call. I don't think there's anything else to do with this issue since it's a local install problem and once in python I'm not sure how to detect it. Closing issue, feel free to re-open if there's anything else to do.

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

Successfully merging a pull request may close this issue.

9 participants