Skip to content

Spacy on m1 pro chip doesn't work #10680

Description

@maroxtn

When following the instructions of installing Spacy on the m1 pro chip, I got an error.
I tried to build it from source, install it in a new virtual environment but the same error persists.

How to reproduce the behaviour

pip install -U pip setuptools wheel
pip install -U 'spacy[apple]'
python -m spacy download en_core_web_sm

When running the third command, I get this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.9/site-packages/spacy/__init__.py", line 11, in <module>
    from thinc.api import prefer_gpu, require_gpu, require_cpu  # noqa: F401
  File "/opt/homebrew/lib/python3.9/site-packages/thinc/api.py", line 2, in <module>
    from .initializers import normal_init, uniform_init, glorot_uniform_init, zero_init
  File "/opt/homebrew/lib/python3.9/site-packages/thinc/initializers.py", line 4, in <module>
    from .backends import Ops
  File "/opt/homebrew/lib/python3.9/site-packages/thinc/backends/__init__.py", line 8, in <module>
    from .cupy_ops import CupyOps, has_cupy
  File "/opt/homebrew/lib/python3.9/site-packages/thinc/backends/cupy_ops.py", line 19, in <module>
    from .numpy_ops import NumpyOps
  File "thinc/backends/numpy_ops.pyx", line 1, in init thinc.backends.numpy_ops
ImportError: dlopen(/opt/homebrew/lib/python3.9/site-packages/cymem/cymem.cpython-39-darwin.so, 0x0002): tried: '/opt/homebrew/lib/python3.9/site-packages/cymem/cymem.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/cymem.cpython-39-darwin.so' (no such file), '/usr/lib/cymem.cpython-39-darwin.so' (no such file)

Your Environment

  • Operating System: MacOs 12.01
  • Python Version Used: 3.9.10
  • spaCy Version Used: latest
  • Environment Information: m1 MacBook Pro 14 inch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions