jbaiter / jpegtran-cffi

Fast, (mostly) lossless JPEG transformations with Python
http://jpegtran-cffi.readthedocs.org
MIT License
145 stars 23 forks source link

Can't install on Mac OS 10.13.4 #22

Closed v18o closed 4 years ago

v18o commented 6 years ago

Hi awsome devs! I need your help, <3

pip install jpegtran-cffi

Stack trace:

Collecting jpegtran-cffi
  Using cached https://files.pythonhosted.org/packages/e5/0e/0caacf608078fc9ec3236f6ccf886dead28519e83a1d536144571ee12ed6/jpegtran-cffi-0.5.2.tar.gz
    Complete output from command python setup.py egg_info:
    In file included from jpegtran/__pycache__/_cffi__xbfac4b5xcdb1023.c:214:
    src/epeg_private.h:14:10: fatal error: 'jpeglib.h' file not found
    #include <jpeglib.h>
             ^
    1 error generated.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/st/dd8jf5rj5bq1nggn2pjlbgvc0000gp/T/pip-install-FV1JeF/jpegtran-cffi/setup.py", line 5, in <module>
        import jpegtran.lib
      File "jpegtran/__init__.py", line 1, in <module>
        from jpegtran.transform import JPEGImage
      File "jpegtran/transform.py", line 5, in <module>
        import jpegtran.lib as lib
      File "jpegtran/lib.py", line 39, in <module>
        libraries=["jpeg"])
      File "/Users/vika/work/env2.7.14/lib/python2.7/site-packages/cffi/api.py", line 444, in verify
        lib = self.verifier.load_library()
      File "/Users/vika/work/env2.7.14/lib/python2.7/site-packages/cffi/verifier.py", line 104, in load_library
        self._compile_module()
      File "/Users/vika/work/env2.7.14/lib/python2.7/site-packages/cffi/verifier.py", line 201, in _compile_module
        outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
      File "/Users/vika/work/env2.7.14/lib/python2.7/site-packages/cffi/ffiplatform.py", line 22, in compile
        outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
      File "/Users/vika/work/env2.7.14/lib/python2.7/site-packages/cffi/ffiplatform.py", line 58, in _build
        raise VerificationError('%s: %s' % (e.__class__.__name__, e))
    cffi.error.VerificationError: CompileError: command '/usr/bin/clang' failed with exit status 1
v18o commented 6 years ago

ping

v18o commented 6 years ago

is this awesome lib abandoned?

ghost commented 6 years ago

You need to install libjpeg-turbo

brew install jpeg-turbo

pngnviko commented 6 years ago

thanks, it works

jecker7 commented 5 years ago

still getting this issue with after brew install jpeg-turbo

cbm755 commented 4 years ago

@jecker7 In my project, we use brew install libjpeg libjpeg-turbo jpeg-turbo.

Quite possibly the libjpeg is needed for a different library, I'm just copy-pasting: I think the libjpeg-turbo is the crucial bit.

cbm755 commented 4 years ago

Note jpeg-turbo and libjpeg-turbo are not the same thing! I had to re-read my July 1 comment twice :-)

Please re-open if that doesn't fix it.

biochem-fan commented 2 years ago

In case others are struggling:

After installing above libraries by Homebrew, I had to set paths to them:

LDFLAGS="-L/opt/homebrew/Cellar/jpeg-turbo/2.1.3/lib" CPPFLAGS="-I/opt/homebrew/Cellar/jpeg-turbo/2.1.3/include/" python3 -m pip install jpegtran-cffi