-
Notifications
You must be signed in to change notification settings - Fork 283
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
Does python-magic work on Apple Silicon? #262
Comments
It looks like you're running a native (ARM) python, but python-magic is finding an Intel copy of the libmagic shared library. Do you know how /usr/local/Cellar/libmagic/5.41/lib/libmagic.dylib got installed? It looks like homebrew now supports M1 officially (just as of a few weeks ago), so could you try get M1-native homebrew packages installed? Alternatively, you could run python from your current Intel homebrew install instead of (presumably) the OS install, and it would use the runtime translation and presumably work at the cost of a speed hit. |
/usr/local/Cellar/libmagic/5.41/lib/libmagic.dylib was installed with brew install libmagic. I'll check again if m1-native homebrew is installed. |
Here has a strange solution:
But I don't know why it works... |
@wshs0713 not sure why that would work... @soimkim are you using homebrew 3.0? That's the one with M1 support, and it defaults to /opt/homebrew according to this page: https://mac.install.guide/homebrew/index.html |
When I installed libmagic I installed it wrong. Thanks for answering my question.👍 |
After running
I had the issue that my python platform was for x86_64, but brew installed the arm64 binaries of libmagic. This resulted in a hidden error about a platform mismatch (#279). Check python-platform: import platform
platform.machine() I then uninstalled the recently installed arm64-libmagic-binaries and installed another homebrew with x86_64 architecture (this is likely overkill): # How to install it with x86 libomp:
# install x86_64 variant of brew
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# install x86_64 variant of libmagic
arch -x86_64 /usr/local/bin/brew install libmagic The alternative would have been to set up the conda environment as arm64 (probably easier): https://stackoverflow.com/questions/65415996/how-to-specify-the-architecture-or-platform-for-a-new-conda-environment-apple |
When Python-magic is installed and executed on Apple Silicon(m1), the following bug occurs. Is there any workaround?
The text was updated successfully, but these errors were encountered: