Matplotlib install failure on Mac OSX 10.8 Mountain Lion

前端 未结 11 1048
眼角桃花
眼角桃花 2020-12-23 02:21

I tried to install matplotlib on my MacBook Air, but it always gives me this error message:

 Processing matplotlib-1.1.1_notests.tar.gz
 Running matplotlib-1         


        
11条回答
  •  别那么骄傲
    2020-12-23 03:09

    I also had a similar issue, and fixed it in a reasonably straightforward way using homebrew.

    You don't have to link the freetype libraries for this reason. The main problem is, after you install freetype using homebrew, you are told to add

    -I/usr/local/opt/freetype/include 
    

    to your CPPFLAGS. However, this alone is not sufficient, and you also have to add the the freetype2 subfolder as well.

    So in order to install matplotlib, do this:

    brew install freetype
    brew install libpng
    LDFLAGS="-L/usr/local/opt/freetype/lib -L/usr/local/opt/libpng/lib" CPPFLAGS="-I/usr/local/opt/freetype/include -I/usr/local/opt/libpng/include -I/usr/local/opt/freetype/include/freetype2" pip install matplotlib
    

提交回复
热议问题