Apple M1 — Matplotlib, Python, and Jupyter Lab

Alex Slobodnik
1 min readNov 30, 2020

--

If you recently purchased a new M1 Apple Silicon Mac, getting your development environment set up takes more effort than using an Intel based Mac. As of writing this, the information online has been limited and unanswered.

My work flow depends on Jupyter Lab, Pandas, and matplotlib. Jupyter Lab installs easily through pip, unfortunately matplotlib fails.

Pip install matplotlib fails because one of its dependencies is pillow and one of pillow’s dependency is libjpeg. The specific error is:

The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.

The quicker solution than reading the installation documentation is

brew install libjpeg

Solving this problem took thirty minutes of googling. I hope it takes you less time.

Working through the small problems with M1 programing reminded of “Wisdom of the Ancients” by xkcd.

Lastly, if you are having issues installing brew, see this post.

--

--

Alex Slobodnik
Alex Slobodnik

Written by Alex Slobodnik

Possessed by the spirit of inquiry.

Responses (1)