19

libjpeg or libjpeg-turbo are requirements for installing Pillow, which is a new requirement for storing images on django. So I need to install Pillow but that won't work until I get jpeg support which comes by way of packages called libjpeg or libjpeg-turbo. I hope that is the case, at least.

This dependency is not an issue on the dev server, but I need to do some work locally, (Macbook Pro OSX 10.11.5). Haven't been able to do it yet or find a solution to install yet for OSX. I was hoping I would find something in pip or conda but there is nothing for OSX. I have seen there are various normal ways to install on Linux.

3 Answers 3

33

Using Homebrew:

brew install jpeg
3
  • 2
    Don't know why I didn't think of homebrew, which I also have already. Thanks a lot! Commented Jul 12, 2016 at 14:20
  • This does not work anymore, the library can not be found.
    – Charklewis
    Commented Nov 16, 2020 at 6:01
  • If I run brew install libjpeg I get the same result as with brew install jpeg so maybe they renamed it, but it still works for me.
    – mirosval
    Commented Dec 2, 2020 at 12:11
4

For libjpeg-turbo

 brew install jpeg-turbo

Then it'll give you instructions on how to add it to your library load path (so that it doesn't conflict with libjpeg, it isn't in the standard paths).

3

Fresh install of Big Sur (macOS 11.0.1) and Homebrew, then :

brew install jpeg

Then installed XCode command line tools (required because of zlib) via

xcode-select --install

Then in zsh for tools to find headers :

export CPATH=`xcrun --show-sdk-path`/usr/include
export LDFLAGS="-L//Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
export CPPFLAGS="-I//Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"

Lastly in a virtual environment (Python 3.8) :

pip install setuptools, wheel, Pillow

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.