gpt4 book ai didi

python-3.x - Numpy 1.11 未安装在 virtualenv @ Ubuntu Studio 中

转载 作者:太空宇宙 更新时间:2023-11-03 16:55:55 35 4
gpt4 key购买 nike

我在 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

我找到了创建符号链接(symbolic link)的解决方法:

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.x - Numpy 1.11 未安装在 virtualenv @ Ubuntu Studio 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51041109/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com