How to solve libmagic.dylib - incompatible architecture error?

I'm trying to install my Django project to my M1 Mac laptop but it is giving errors.

..OSError: dlopen(/Users/e.celik/Library/Python/3.8/lib/python/site-packages/magic/libmagic/libmagic.dylib, 0x0006): tried: 
'/Users/e.celik/Library/Python/3.8/lib/python/site-packages/magic/libmagic/libmagic.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), 
'/System/Volumes/Preboot/Cryptexes/OS/Users/e.celik/Library/Python/3.8/lib/python/site-packages/magic/libmagic/libmagic.dylib' (no such file), 
'/Users/e.celik/Library/Python/3.8/lib/python/site-packages/magic/libmagic/libmagic.dylib' 
(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

I do not know why is this happening? I'm using python 3.8 and last version of pip.

How can I fix that?

Back to Top