Step to reproduce the problem:
FROM python:2.7.11-alpine
RUN echo @testing http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
apk add --update gfortran build-base py-numpy@testing
leads to:
Python 2.7.11 (default, May 12 2016, 18:32:26)
[GCC 5.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named numpy
Manually installing python from apk on clean Alpine docker image is working fine.