python-通过pip安装scikit-bio时出现#error“未启用SSE2指令集”
作者:互联网
我想使用以下命令通过pip安装python库scikit-bio:
sudo pip install scikit-bio
在我的系统上:
uname -a
Linux grassgis 3.2.0-69-generic-pae #103-Ubuntu SMP Tue Sep 2 05:15:53 UTC 2014 i686 i686 i386 GNU/Linux
但是,这会导致错误:
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c skbio/alignment/_ssw/_ssw_wrapper.c -o build/temp.linux-i686-2.7/skbio/alignment/_ssw/_ssw_wrapper.o
In file included from skbio/alignment/_ssw/ssw.h:17:0,
from skbio/alignment/_ssw/_ssw_wrapper.c:355:
/usr/lib/gcc/i686-linux-gnu/4.6/include/emmintrin.h:32:3: error: #error "SSE2 instruction set not enabled"
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/__multiarray_api.h:1532:1: warning: ‘_import_array’ defined but not used [-Wunused-function]
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/__ufunc_api.h:226:1: warning: ‘_import_umath’ defined but not used [-Wunused-function]
error: command 'gcc' failed with exit status 1
我已经运行了sudo apt-get update和sudo apt-get upgrade以获取已安装软件的最新版本.
我的GCC版本是:
gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
如何成功为python安装scikit-bio软件包?
解决方法:
以前在scikit-bio问题跟踪器上使用i686机器的问题是reported by a user.编译SSW是scikit-bio附带的外部C程序时,会发生此错误. SSW的作者建议将-msse2传递给编译器以解决此问题.
fix was merged进入scikit-bio的开发分支,其中包括用于i686机器的此标志.
如果要安装scikit-bio的发行版,则可以在命令行上通过CFLAGS指定此标志:
CFLAGS=-msse2 pip install scikit-bio
要么:
sudo CFLAGS=-msse2 pip install scikit-bio
或者,可以将scikit-bio的setup.py文件修改为在SSW的extra_compile_args中包含“ -msse2”.
标签:sse2,gcc,skbio,python,pip 来源: https://codeday.me/bug/20191029/1957281.html