Skip to content

matplotlib installation from source and numpy incompatibility #10135

Closed
@grzanka

Description

@grzanka

Bug report

Bug summary

After installing matplotlib 2.1.1 via pip (using source package , .tar.gz) it fails to run due to incompatibility with numpy API.

Code for reproduction

I've used docker on debian 8 to test it with default python (2.7) and default pip (1.5):

→ docker run --rm -it debian:8 bash
root@49c12ed51a55:/# apt-get update -qq
root@49c12ed51a55:/# apt-get install python-pip libpng12-dev libfreetype6-dev pkg-config 
(...)
root@49c12ed51a55:/# pip install matplotlib 1>stdout.log 2>stderr.log
root@49c12ed51a55:/# python -c "import matplotlib.artist as martist"
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/artist.py", line 16, in <module>
    from .path import Path
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/path.py", line 25, in <module>
    from . import _path, rcParams
ImportError: numpy.core.multiarray failed to import
root@49c12ed51a55:/# python -V
Python 2.7.9
root@49c12ed51a55:/# python -c "import matplotlib; print(matplotlib.get_backend())"
agg
root@49c12ed51a55:/# cat stdout.log | grep NPY_API_VERSION
    #define NPY_API_VERSION 0x0000000C
    #define NPY_API_VERSION 0x0000000B

Matplotlib version

  • Operating system: Linux, debian 8 (in docker)
  • Matplotlib version: 2.1.1
  • Matplotlib backend (print(matplotlib.get_backend())): agg
  • Python version: 2.7.9
  • Other libraries: docker, debian 8

The problem was triggered by some other package with which I had trouble to produce wheels. See discussion here: pytrip/pytrip#419 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions