使用 pip 安装 spaCy 失败,错误 "Failed building wheel for blis"
installing spaCy with pip failed with error "Failed building wheel for blis"
尝试使用 pip(版本 20.0.2)安装 spaCy
但出现如下错误
gcc -c /tmp/pip-install-f2b27qwm/blis/blis/_src/kernels/zen/1/bli_amaxv_zen_int.c -o /tmp/tmpu1wg8fg1/bli_amaxv_zen_int.o -O3 -mavx2 -mfma -mfpmath=sse -march=core-avx2 -fPIC -std=c99 -D_POSIX_C_SOURCE=200112L -DBLIS_VERSION_STRING="0.5.1" -DBLIS_IS_BUILDING_LIBRARY -Iinclude/linux-x86_64 -I./frame/3/ -I./frame/ind/ukernels/ -I./frame/1m/ -I./frame/1f/ -I./frame/1/ -I./frame/include -I/tmp/pip-install-f2b27qwm/blis/blis/_src/include/linux-x86_64
gcc: error: unrecognized command line option '-mavx2'
gcc: error: unrecognized command line option '-mfma'
gcc: error: unrecognized command line option '-mfpmath=sse'
gcc: error: unrecognized command line option '-march=core-avx2'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-f2b27qwm/blis/setup.py", line 277, in <module>
"Topic :: Scientific/Engineering",
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run
self.run_command('build')
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/tmp/pip-install-f2b27qwm/blis/setup.py", line 103, in build_extensions
objects = self.compile_objects(compiler.split("-")[0], arch, OBJ_DIR)
File "/tmp/pip-install-f2b27qwm/blis/setup.py", line 188, in compile_objects
objects.append(self.build_object(env=env, **spec))
File "/tmp/pip-install-f2b27qwm/blis/setup.py", line 201, in build_object
subprocess.check_call(command, cwd=BLIS_DIR)
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['gcc', '-c', '/tmp/pip-install-f2b27qwm/blis/blis/_src/kernels/zen/1/bli_amaxv_zen_int.c', '-o', '/tmp/tmpu1wg8fg1/bli_amaxv_zen_int.o', '-O3', '-mavx2', '-mfma', '-mfpmath=sse', '-march=core-avx2', '-fPIC', '-std=c99', '-D_POSIX_C_SOURCE=200112L', '-DBLIS_VERSION_STRING="0.5.1"', '-DBLIS_IS_BUILDING_LIBRARY', '-Iinclude/linux-x86_64', '-I./frame/3/', '-I./frame/ind/ukernels/', '-I./frame/1m/', '-I./frame/1f/', '-I./frame/1/', '-I./frame/include', '-I/tmp/pip-install-f2b27qwm/blis/blis/_src/include/linux-x86_64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for blis
Running setup.py clean for blis
Failed to build numpy blis
ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
----------------------------------------
ERROR: Command errored out with exit status 1: /home/{user_name}/.conda/envs/ncn/bin/python /home/{user_name}/.conda/envs/ncn/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-3j47_tuc/normal --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'cython>=0.25' 'thinc<7.4.0,>=7.3.0' 'preshed<3.1.0,>=3.0.2' 'murmurhash<1.1.0,>=0.28.0' wheel 'cymem<2.1.0,>=2.0.2' Check the logs for full command output.
好像有numpy的问题
但是我在安装pytorch(1.12.0)的时候已经安装了numpy(1.16.5)
一些Whosebug的解决方案没有解决问题
()
()
因为我的机器运行在ppc64le,IBM watson机器上。
所以我的机器没有轮子。
有几个包可用 (https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda/#/)
但 spaCy 不是其中之一。
安装 spaCy 需要做什么?
看起来该包正在尝试使用 x86 特定标志构建代码:-mavx
、使用 SSE 的标志等。您应该就此联系包作者:他们需要将他们的包更改为不要在 x86 以外的平台上使用这些标志。
您可以在最近新增的powerai补充频道中安装spacy 2.2.1版本为ppc64le编译。
conda install -c powerai spacy
您也可以 git clone https://github.com/IBM/powerai
并将 https://github.com/IBM/powerai/blob/master/conda-recipes/spacy-feedstock/recipe/meta.yaml#L2-L3 修改为 2.1.6 版本,然后如果您需要特定版本,则自己使用 conda-build 包。 (然后您将从 conda-recipes/spacy-feedstock
目录 运行 conda-build 生成 conda 包)
尝试使用 pip(版本 20.0.2)安装 spaCy
但出现如下错误
gcc -c /tmp/pip-install-f2b27qwm/blis/blis/_src/kernels/zen/1/bli_amaxv_zen_int.c -o /tmp/tmpu1wg8fg1/bli_amaxv_zen_int.o -O3 -mavx2 -mfma -mfpmath=sse -march=core-avx2 -fPIC -std=c99 -D_POSIX_C_SOURCE=200112L -DBLIS_VERSION_STRING="0.5.1" -DBLIS_IS_BUILDING_LIBRARY -Iinclude/linux-x86_64 -I./frame/3/ -I./frame/ind/ukernels/ -I./frame/1m/ -I./frame/1f/ -I./frame/1/ -I./frame/include -I/tmp/pip-install-f2b27qwm/blis/blis/_src/include/linux-x86_64
gcc: error: unrecognized command line option '-mavx2'
gcc: error: unrecognized command line option '-mfma'
gcc: error: unrecognized command line option '-mfpmath=sse'
gcc: error: unrecognized command line option '-march=core-avx2'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-f2b27qwm/blis/setup.py", line 277, in <module>
"Topic :: Scientific/Engineering",
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run
self.run_command('build')
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/tmp/pip-install-f2b27qwm/blis/setup.py", line 103, in build_extensions
objects = self.compile_objects(compiler.split("-")[0], arch, OBJ_DIR)
File "/tmp/pip-install-f2b27qwm/blis/setup.py", line 188, in compile_objects
objects.append(self.build_object(env=env, **spec))
File "/tmp/pip-install-f2b27qwm/blis/setup.py", line 201, in build_object
subprocess.check_call(command, cwd=BLIS_DIR)
File "/home/{user_name}/.conda/envs/ncn/lib/python3.7/subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['gcc', '-c', '/tmp/pip-install-f2b27qwm/blis/blis/_src/kernels/zen/1/bli_amaxv_zen_int.c', '-o', '/tmp/tmpu1wg8fg1/bli_amaxv_zen_int.o', '-O3', '-mavx2', '-mfma', '-mfpmath=sse', '-march=core-avx2', '-fPIC', '-std=c99', '-D_POSIX_C_SOURCE=200112L', '-DBLIS_VERSION_STRING="0.5.1"', '-DBLIS_IS_BUILDING_LIBRARY', '-Iinclude/linux-x86_64', '-I./frame/3/', '-I./frame/ind/ukernels/', '-I./frame/1m/', '-I./frame/1f/', '-I./frame/1/', '-I./frame/include', '-I/tmp/pip-install-f2b27qwm/blis/blis/_src/include/linux-x86_64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for blis
Running setup.py clean for blis
Failed to build numpy blis
ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
----------------------------------------
ERROR: Command errored out with exit status 1: /home/{user_name}/.conda/envs/ncn/bin/python /home/{user_name}/.conda/envs/ncn/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-3j47_tuc/normal --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'cython>=0.25' 'thinc<7.4.0,>=7.3.0' 'preshed<3.1.0,>=3.0.2' 'murmurhash<1.1.0,>=0.28.0' wheel 'cymem<2.1.0,>=2.0.2' Check the logs for full command output.
好像有numpy的问题
但是我在安装pytorch(1.12.0)的时候已经安装了numpy(1.16.5)
一些Whosebug的解决方案没有解决问题
(
因为我的机器运行在ppc64le,IBM watson机器上。 所以我的机器没有轮子。 有几个包可用 (https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda/#/) 但 spaCy 不是其中之一。
安装 spaCy 需要做什么?
看起来该包正在尝试使用 x86 特定标志构建代码:-mavx
、使用 SSE 的标志等。您应该就此联系包作者:他们需要将他们的包更改为不要在 x86 以外的平台上使用这些标志。
您可以在最近新增的powerai补充频道中安装spacy 2.2.1版本为ppc64le编译。
conda install -c powerai spacy
您也可以 git clone https://github.com/IBM/powerai
并将 https://github.com/IBM/powerai/blob/master/conda-recipes/spacy-feedstock/recipe/meta.yaml#L2-L3 修改为 2.1.6 版本,然后如果您需要特定版本,则自己使用 conda-build 包。 (然后您将从 conda-recipes/spacy-feedstock
目录 运行 conda-build 生成 conda 包)