2

I'm trying to install matplotlib on a raspberry pi with a clean installation of Raspbian Jessie (4.4 at time of writing). I am trying to install matplotlib for Python 2.7.

I keep getting the following error:

command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-HPuMoo/matplotlib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-l3s1dW-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-HPuMoo/matplotlib

Storing debug log for failure in /home/pi/.pip/pip.log

to complicate things... this doesn't happen when I install other packages (just installed virtualenv without issue) but it DOES happen when I try to upgrade numpy.

In addition, this error occurs when working on the main distribution of Python (/usr/bin/python) or on a virtual environment (/home/pi/Envs/test/bin/python). I am, then, using pip 1.5.6 on the main distribution and 9.0.1 on the virtualenv. both fail. :(

Not sure why I'm having problems with this... considering how widely used matplotlib is (and how loaded with python packages Jessie is), you'd think there would be no issue. hm.

ajdigregorio
  • 194
  • 1
  • 1
  • 15
  • What command do you run to start the installation? Anything useful in `pip.log`? – MB-F Apr 25 '17 at 14:37
  • I'm just doing `pip install matplotlib`. the end of the log says `error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1` – ajdigregorio Apr 25 '17 at 14:51
  • Can you post the relevant portion of the log? (That is, if you can tell which part is relevant and if it is not too long.) – MB-F Apr 25 '17 at 14:55

1 Answers1

2

Per this answer by Peter Brittain and Anshuman Chhabra, installing the libpulse-dev and python-dev libraries should solve your problem. As shown on the Debian Packages references, the file lists of these libraries include the required files.

seanbaird
  • 36
  • 4
  • This worked for me! Not sure why python-dev and libpulse-dev are not installed by default, but that's a problem for the rpi devs to solve. – ajdigregorio Apr 25 '17 at 15:58