I am having significant trouble installing some Python libraries/dependencies for a project I have to work on, specifically with libmagic. I have tried to install libmagic several ways with no success - installing it through my code editor terminal, installing it through terminal with pip, installing it via Homebrew (including removing Python and existing items and re-installing everything with homebrew).
I consistently receive the following error:
ImportError('failed to find libmagic. Check your installation')
to which I tried to install libmagic with pip. However, I can find a libmagic folder/file after this, but I continue receiving errors, such as a ModuleNotFoundError
when I try to run import magic. I tried various pip install commands with no luck.
I then tried to uninstall everything Python and libmagic related, and reinstall it these Homebrew instructions), and I continued to get errors. I also tried installing it using Python libmagic for Apple Silicon, and it did not work.
Finally, with the help of a colleague, he used the terminal to determine that there was an architecture error, very similar to this incompatibility error listed in How to solve libmagic.dylib - incompatible architecture error?. I tried following some of the suggestions such as arch -arm64 brew install python
, or arch -arm64 brew install libmagic
, which had no success.
Does anyone have any idea what I can do here? It is more or less the last dependency I need to install and it's causing so many issues. I will happily uninstall everything again and start from zero if there is a clear way of having this work. Maybe there is a step I need to do, similar to the arm64 brew python
install to help facilitate it installing properly.
/usr/local/bin
) or the ARM version (in/opt/homebrew/bin
)? How did you install Python, and pip?% which brew /usr/local/bin/brew
arch -arm64
.