用pip安装spaCy失败,并显示错误“ blis的建筑车轮失败”

时间:2020-01-26 16:15:03

标签: pip spacy powerpc

试图通过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.

似乎有一些问题

但是我在安装pytorch(1.12.0)时已经安装了numpy(1.16.5)

一些stackoverflow解决方案无法解决问题 (Python Cannot install module spaCy) (Failed building wheel for spacy

因为我的机器在IBM watson机器ppc64le上运行。 所以我的机器没有轮子。 几个软件包可用(https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda/#/) 但是spaCy不是其中之一。

我应该如何安装spaCy?

2 个答案:

答案 0 :(得分:1)

您可以在最新添加的powerai补充频道中安装为ppc64le编译的spacy 2.2.1版本。

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构建软件包。 (然后,您可以从conda-recipes/spacy-feedstock目录运行conda-build来生成conda软件包)

答案 1 :(得分:0)

该软件包似乎正在尝试使用x86特定标志来构建代码:-mavx,使用SSE的标志等。您应就此问题与软件包作者联系:他们需要将其软件包更改为不使用在x86以外的平台上的那些标志。