Pip install Matplotlib error with virtualenv

后端 未结 11 699
心在旅途
心在旅途 2020-11-29 15:58

I am trying to install matplotlib in a new virtualenv.

When I do:

pip install matplotlib

or

pip install http://so         


        
相关标签:
11条回答
  • 2020-11-29 16:11

    If on MacOSx try

    xcode-select --install
    

    This complies subprocess 32, the reason for the failure.

    0 讨论(0)
  • 2020-11-29 16:14

    As I have struggled with this issue twice (even after fresh kubuntu 15.04 install) and installing freetype did not solve anything, I investigated further.

    The solution:
    From github issue:

    This bug only occurs if pkg-config is not installed;
    a simple
    sudo apt-get install pkg-config
    will shore up the include paths for now.

    After this installation proceeds smoothly.

    0 讨论(0)
  • 2020-11-29 16:16

    Building Matplotlib requires libpng (and freetype, as well) which isn't a python library, so pip doesn't handle installing it (or freetype).

    You'll need to install something along the lines of libpng-devel and freetype-devel (or whatever the equivalent is for your OS).

    See the building requirements/instructions for matplotlib.

    0 讨论(0)
  • 2020-11-29 16:17

    To generate graph in png format you need to Install following dependent packages

    sudo apt-get install libpng-dev
    sudo apt-get install libfreetype6-dev
    

    Ubuntu https://apps.ubuntu.com/cat/applications/libpng12-0/ or using following command

    sudo apt-get install libpng12-0
    
    0 讨论(0)
  • 2020-11-29 16:19

    On OSX I was able to get matplotlib to install via:

    pip install matplotlib==1.4.0
    

    only after I ran:

    brew install freetype
    
    0 讨论(0)
  • 2020-11-29 16:22

    As a supplementary, on Amazon EC2, what I need to do is:

    sudo yum install freetype-devel
    sudo yum install libpng-devel
    sudo pip install matplotlib
    
    0 讨论(0)
提交回复
热议问题