Pip install Matplotlib error with virtualenv

后端 未结 11 726
心在旅途
心在旅途 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:24

    To reduce the required packages to install you just need

    apt-get install -y \
        libfreetype6-dev \
        libxft-dev && \
        pip install matplotlib
    

    and you will get the following packages locally installed

    Collecting matplotlib
      Downloading matplotlib-2.2.0-cp35-cp35m-manylinux1_x86_64.whl (12.5MB)
    Collecting pytz (from matplotlib)
      Downloading pytz-2018.3-py2.py3-none-any.whl (509kB)
    Collecting python-dateutil>=2.1 (from matplotlib)
      Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
    Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib)
      Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)
    Requirement already satisfied: six>=1.10 in /opt/conda/envs/pytorch-py35/lib/python3.5/site-packages (from matplotlib)
    Collecting cycler>=0.10 (from matplotlib)
      Downloading cycler-0.10.0-py2.py3-none-any.whl
    Collecting kiwisolver>=1.0.1 (from matplotlib)
      Downloading kiwisolver-1.0.1-cp35-cp35m-manylinux1_x86_64.whl (949kB)
    Requirement already satisfied: numpy>=1.7.1 in /opt/conda/envs/pytorch-py35/lib/python3.5/site-packages (from matplotlib)
    Requirement already satisfied: setuptools in /opt/conda/envs/pytorch-py35/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg (from kiwisolver>=1.0.1->matplotlib)
    Installing collected packages: pytz, python-dateutil, pyparsing, cycler, kiwisolver, matplotlib
    Successfully installed cycler-0.10.0 kiwisolver-1.0.1 matplotlib-2.2.0 pyparsing-2.2.0 python-dateutil-2.6.1 pytz-2018.3
    
    0 讨论(0)
  • 2020-11-29 16:29

    Another option is to install anaconda, which comes with packages such as: Matplotlib, numpy and pandas.

    https://anaconda.org

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

    Under Windows this worked for me:

    python -m pip install -U pip setuptools
    python -m pip install matplotlib
    

    (from https://matplotlib.org/users/installing.html)

    0 讨论(0)
  • 2020-11-29 16:37
    sudo apt-get install libpng-dev libjpeg8-dev libfreetype6-dev
    

    worked for me on Ubuntu 14.04

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

    None of the above answers worked for me in Mint, so I did:

    sudo apt-get install build-essential g++
    
    0 讨论(0)
提交回复
热议问题