lilohuang/PyTurboJPEG

Not working on mac m2 with python3.7

dingusagar opened this issue · 1 comments

I did brew install jpeg-turbo

And when I try to do

from turbojpeg import TurboJPEG
jpeg = TurboJPEG()

I get the following error

OSError: dlopen(/opt/homebrew/opt/jpeg-turbo/lib/libturbojpeg.dylib, 0x0006): tried: '/opt/homebrew/opt/jpeg-turbo/lib/libturbojpeg.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))), '/opt/homebrew/Cellar/jpeg-turbo/2.1.4/lib/libturbojpeg.0.2.0.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))

I think this is because I used x86_64 for python installation. Any way to get around this problem? It works on my default python3.9 which came with the mac.

@dingusagar you can specify to x86_64 TurboJPEG dynamic library path manually e.g.

jpeg = TurboJPEG('/opt/libjpegturbo-x86_64/libturbojpeg.dylib')

x86_64 TurboJPEG might be available in https://sourceforge.net/projects/libjpeg-turbo/files/2.1.4/