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.

jeffery_the_wind
  • 17,048
  • 34
  • 98
  • 160

3 Answers3

33

Using Homebrew:

brew install jpeg
rogerdpack
  • 62,887
  • 36
  • 269
  • 388
mirosval
  • 6,671
  • 3
  • 32
  • 46
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).

rogerdpack
  • 62,887
  • 36
  • 269
  • 388
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
rogerdpack
  • 62,887
  • 36
  • 269
  • 388
Den
  • 31
  • 3