'Numpy 1.11 doesn't install in virtualenv @ Ubuntu Studio

I have Python 3 virtualenv set up @ 4.15.0-23-lowlatency #25-Ubuntu.
Inside virtualenv I have numpy1.14 installed. I want to install numpy1.11.
I get the error:

numpy/core/src/multiarray/numpyos.c:18:10: fatal error: xlocale.h: No such file or directory
   #include <xlocale.h>
            ^~~~~~~~~~~
  compilation terminated.
  numpy/core/src/multiarray/numpyos.c:18:10: fatal error: xlocale.h: No such file or directory
   #include <xlocale.h>
            ^~~~~~~~~~~
  compilation terminated.
  error: Command "x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-EKG1lX/python3.6-3.6.5=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Ibuild/src.linux-x86_64-3.6/numpy/core/src/private -Inumpy/core/include -Ibuild/src.linux-x86_64-3.6/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -I/home/kujaw/.virtualenvs/coursera_audio3/include/python3.6m -Ibuild/src.linux-x86_64-3.6/numpy/core/src/private -Ibuild/src.linux-x86_64-3.6/numpy/core/src/private -Ibuild/src.linux-x86_64-3.6/numpy/core/src/private -c numpy/core/src/multiarray/numpyos.c -o build/temp.linux-x86_64-3.6/numpy/core/src/multiarray/numpyos.o" failed with exit status 1

I have found a workaround to create a symlink:

ln -s /usr/include/locale.h /usr/include/xlocale.h

but it doesn't work. Could someone provide correct solution to this?



Solution 1:[1]

There exists pre-built binary package for your platform, you should be able install it via wheel:

pip install wheel  
pip install numpy==1.11.*

If you have some reasons to build the package from source instead, according to this commit, I think it's better to

ln -s /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h /usr/include/xlocale.h

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vinzee