Numpy 1.11 未安装在 virtualenv @ Ubuntu Studio 中

kuj*_*jaw 4 ubuntu numpy pip virtualenv python-3.x

我在 4.15.0-23-lowlatency #25-Ubuntu 上设置了 Python 3 virtualenv。
在 virtualenv 中,我安装了 numpy1.14。我想安装numpy1.11。
我收到错误:

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

我找到了一种创建符号链接的解决方法

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

但它不起作用。有人可以为此提供正确的解决方案吗?

And*_*sky 5

您的平台存在预先构建的二进制包,您应该可以通过wheel以下方式安装它:

pip 安装轮
pip 安装 numpy==1.11.*

如果你有一些理由从源代码构建包,根据这个提交,我认为最好

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