ahupp / python-magic

A python wrapper for libmagic
Other
2.59k stars 280 forks source link

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

Closed TheNoShade closed 3 months ago

TheNoShade commented 4 months ago

I have docker based python project. When trying to import magic and up my container I'm facing below error

File "/usr/local/lib/python3.11/site-packages/magic/loader.py", line 49, in load_lib raise ImportError('failed to find libmagic. Check your installation') ImportError: failed to find libmagic. Check your installation

When I'm trying to install python-libmagic below error occurred

error: command '/usr/bin/gcc' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for cffi Running setup.py clean for cffi Successfully built python-libmagic Failed to build cffi ERROR: Could not build wheels for cffi, which is required to install pyproject.toml-based projects

I tried many things but all in vain. Please help to solve this issue. Thanks.

ddelange commented 4 months ago

Hi @TheNoShade 👋

ahupp commented 3 months ago

Yes, ^^ that's true. Too many similarly named packages unfortunately.