Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build spacy #7335

Closed
handhikadj opened this issue Mar 8, 2021 · 2 comments
Closed

Failed to build spacy #7335

handhikadj opened this issue Mar 8, 2021 · 2 comments
Labels
install Installation issues

Comments

@handhikadj
Copy link

How to reproduce the problem

Run pip3 install -U spacy

 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/tcl-tk/include -I/Users/handika/Sites/python-practice/venv/include -I/opt/homebrew/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c spacy/training/example.cpp -o build/temp.macosx-11-arm64-3.9/spacy/training/example.o -std=c++11 -O2 -Wno-strict-prototypes -Wno-unused-function
  spacy/training/example.cpp:641:10: fatal error: 'numpy/arrayobject.h' file not found
  #include "numpy/arrayobject.h"
           ^~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  error: command '/usr/bin/clang' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for spacy
Failed to build spacy
ERROR: Could not build wheels for spacy which use PEP 517 and cannot be installed directly

Your Environment

  • Operating System: MacOS Big Sur
  • Python Version Used: Python 3.9.1
  • spaCy Version Used: latest
  • Environment Information: Apple M1
@adrianeboyd adrianeboyd added the install Installation issues label Mar 8, 2021
@adrianeboyd
Copy link
Contributor

adrianeboyd commented Mar 8, 2021

The situation with pip installing numpy or libraries that compile against numpy on apple m1 is very frustrating currently. There are no numpy binary wheels (numpy's official position is that apple m1 is not supported) and the source distribution fails to compile correctly due to the pinned wheel version in the numpy setup (currently for numpy 1.19.3--1.20.1), so any packages that use build isolation by default fail to get installed correctly. (numpy itself uses build isolation and so do our packages.) I should probably write a blog post on how to do this, but the basics are here:

explosion/thinc#474 (comment)

If you just want to use spacy and you don't mind using conda, the easiest option is to install binary packages from conda-forge.

With pip, I think the easiest option if you just want to install spacy once and use it is the one with PIP_CONSTRAINT, but if you're modifying the library and recompiling frequently, the method for installing without build isolation is more suitable.

I don't recommend using the provided /usr/bin/python3 and the homebrew python3 is not going to work correctly in the source install until spacy v3.0.4 is released.

@adrianeboyd
Copy link
Contributor

Let me move this to the new discussion topic we created for installation issues. This issue will be locked, but the new discussion thread will be open.

@explosion explosion locked and limited conversation to collaborators Mar 10, 2021
@explosion explosion unlocked this conversation Apr 29, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
install Installation issues
Projects
None yet
Development

No branches or pull requests

2 participants