Numpy 1.11 未安装在 virtualenv @ Ubuntu Studio 中
Numpy 1.11 doesn't install in virtualenv @ Ubuntu Studio
我已经 Python 3 virtualenv 设置 @ 4.15.0-23-lowlatency #25-Ubuntu.
在 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
但它不起作用。有人可以为此提供正确的解决方案吗?
存在适用于您的平台的预构建二进制包,您应该可以通过 wheel
:
安装它
pip install wheel
pip install numpy==1.11.*
根据 this commit,如果您出于某种原因而不是从源代码构建包,我认为
更好
ln -s /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h /usr/include/xlocale.h
我已经 Python 3 virtualenv 设置 @ 4.15.0-23-lowlatency #25-Ubuntu.
在 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
但它不起作用。有人可以为此提供正确的解决方案吗?
存在适用于您的平台的预构建二进制包,您应该可以通过 wheel
:
pip install wheel
pip install numpy==1.11.*
根据 this commit,如果您出于某种原因而不是从源代码构建包,我认为
更好ln -s /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h /usr/include/xlocale.h