Skip to content
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

Numpy build dependency is causing install errors #13624

Open
percevalw opened this issue Sep 12, 2024 · 1 comment
Open

Numpy build dependency is causing install errors #13624

percevalw opened this issue Sep 12, 2024 · 1 comment

Comments

@percevalw
Copy link

percevalw commented Sep 12, 2024

How to reproduce the behaviour

Hi, it seems that the latest spacy release has bumped the numpy build dependency:

[build-system]
requires = [
    "setuptools",
    "cython>=0.25,<3.0",
    "cymem>=2.0.2,<2.1.0",
    "preshed>=3.0.2,<3.1.0",
    "murmurhash>=0.28.0,<1.1.0",
    "thinc>=8.3.0,<8.4.0",
    "numpy>=2.0.0,<2.1.0; python_version < '3.9'",
    "numpy>=2.0.0,<2.1.0; python_version >= '3.9'",
]

(from pyproject.toml in the pypi source distribution)

These requirements are not the same as the one on the main branch of your repo: https://github.com/explosion/spaCy/blob/30f1f33e78e123d8ba9cf10ee8edb98a5a5e7170/pyproject.toml#L1C1-L12C40

breaking installations for earlier python versions (I think numpy 2.0 is only py > 3.10 ?), see below:

Notice:  A new release of pip is available: 23.0.1 -> 24.0
Notice:  To update, run: pip install --upgrade pip
error: Failed to build: `edsnlp @ file:///home/runner/work/edsnlp/edsnlp`
  Caused by: Failed to install requirements from `build-system.requires` (install)
  Caused by: Failed to prepare distributions
  Caused by: Failed to fetch wheel: spacy==3.8.0
  Caused by: Failed to install requirements from `build-system.requires` (resolve)
  Caused by: No solution found when resolving: setuptools, cython>=0.25, <3.0, cymem>=2.0.2, <2.1.0, preshed>=3.0.2, <3.1.0, murmurhash>=0.28.0, <1.1.0, thinc>=8.3.0, <8.4.0, numpy>=2.0.0, <2.1.0 ; python_full_version < '3.9', numpy>=2.0.0, <2.1.0 ; python_full_version >= '3.9'
  Caused by: Because only the following versions of numpy{python_full_version < '3.9'} are available:
    numpy{python_full_version < '3.9'}<=2.0.0
    numpy{python_full_version < '3.9'}==2.0.1
    numpy{python_full_version < '3.9'}==2.0.2
    numpy{python_full_version < '3.9'}>2.1.0
and the current Python version (3.7.17) does not satisfy Python>=3.8, we can conclude that numpy{python_full_version < '3.9'}>=2.0.0,<2.1.0 is incompatible.
And because you require numpy{python_full_version < '3.9'}>=2.0.0,<2.1.0, we can conclude that your requirements are unsatisfiable.

Your Environment

  • Operating System: Linux
  • Python Version Used: 3.7/3.8/3.9
  • spaCy Version Used: 3.8.0
  • Environment Information:
@honnibal
Copy link
Member

honnibal commented Sep 14, 2024

There was a problem with the metadata on that release. It shouldn't list support for older Pythons. I've yanked the release and am rebuilding.

Python only allows you to have one version of each library in the tree at once, and spaCy cannot support both numpy v1 and numpy v2 as they're binary incompatible. We need to update the pin to allow people to use spaCy with other libraries that require numpy v2. If numpy v2 doesn't support Python 3.8, this means spaCy can't support it either.

The only solution is to update your Python, or continue using the version of spaCy that's been working for you.

Python versions release every year now, which means the build matrix will grow quickly for libraries like numpy and spaCy that need to build wheels for each version of Python. This means libraries have to prune support for older Pythons, and you'll need to update your Python version periodically in order to keep using new library releases in the ML/data stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants