-
Notifications
You must be signed in to change notification settings - Fork 163
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
python-magic-bin not available for ARM Mac #567
Comments
pull request in R to address this it seems. |
Getting this error on a brand new ARM mac: Any thoughts? |
Ended up adding libmagic via MacPorts. Worked. |
Also works with brew. |
I think I have seen this on a windows also. May need an adjustment to the requirements text file |
As mentioned on the PyPI for python-magic web page, this module is a simple wrapper around the libmagic C library, which must also be installed. With python-magic module: With the new filetype module: New signatures can easily be added as required. @abrignoni If you think this is a possible alternative, I'm willing to create a branch in my own repository for testing purposes. |
I agree. If we can confirm there are no scripts that need any special
functionality that filetype couldn't give then we should change it.
…On Wed, Dec 13, 2023, 4:47 AM Johann POLEWCZYK ***@***.***> wrote:
As mentioned on the PyPI for python-magic web page, this module is a
simple wrapper around the libmagic C library, which must also be installed.
More than just adjusting the requirements.txt file, I think we should
consider an alternative solution, as it may become a little more
complicated for the user to have to install brew or macports on Mac or DLLs
on Windows in order to use iLEAPP.
As the magic module is not widely used in iLEAPP, we could stop using it
and use instead an alternative one which appears to offer identical
functionality for retrieving the extension and mime type of a file.
This is the filetype module, which is simply installed with pip install
filetype and requires no special dependencies. This wouldn't require too
many changes to the current code.
With python-magic module:
mimetype = magic.from_file(filepath, mime=True)
Output examples: image/jpeg, image/png, audio/amr, audio/x-wav, video/mp4
With the new filetype module:
mimetype = filetype.guess(filepath).mime
Output examples: image/jpeg, image/png, audio/amr, audio/x-wav, video/mp4
New signatures can easily be added as required.
@abrignoni <https://github.com/abrignoni> If you think this is a possible
alternative, I'm willing to create a branch in my own repository for
testing purposes.
—
Reply to this email directly, view it on GitHub
<#567 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG3DPC77AZOB6XCCH636IJDYJF2UHAVCNFSM6AAAAAA6BNJZP2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJTGU4DOMRSHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
python-magic is only used in
|
@abrignoni @JamesHabben @stark4n6
|
@Johann-PLW Lets change it. No need to have a dependency that causes issues for no benefit. |
pip installing requirements stopped with:
ERROR: Could not find a version that satisfies the requirement python-magic-bin==0.4.14 (from versions: none)
ERROR: No matching distribution found for python-magic-bin==0.4.14
I see that the spec does cater to ARM Mac:
python-magic==0.4.24; platform_system == "Linux"
python-magic-bin==0.4.14; platform_system == "Windows"
python-magic-bin==0.4.14; platform_system == "Darwin"
python-magic; platform_system == "Darwin" and platform_machine == "arm64"
So I've no idea why it still stopped with an error. Any idea please? Right now I just comment out the lines with python-magic-bin and it seems to work.
The text was updated successfully, but these errors were encountered: