Skip to content

numpy build fails for lack of numpy.math #3150

Closed

Description

@clayote

buildozer debug seemed to work fine yesterday, but then I added armeabi-v7a to its archs and now this is happening:

cython -M --fast-fail -3 /home/sanotehu/src/lisien/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/numpy/armeabi-v7a__ndk_target_24/numpy/numpy/random/_common.pyx -o numpy/random/_common.cpython-311-x86_64-linux-gnu.so.p/numpy/random/_common.pyx.c
Ignoring "sys._home = value" override

Error compiling Cython file:
------------------------------------------------------------
...
from collections import namedtuple
from cpython cimport PyFloat_AsDouble
import sys
import numpy as np
cimport numpy as np
cimport numpy.math as npmath
        ^
------------------------------------------------------------

/home/sanotehu/src/lisien/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/numpy/armeabi-v7a__ndk_target_24/numpy/numpy/random/_common.pyx:8:8: 'numpy/math.pxd' not found

Full log, as well as my buildozer.spec, are at this gist.

Activity

  1. T-Dynamos commented on May 10, 2025

    @T-Dynamos
    Member

    Do try building on this branch #3136

  2. changed the title [-]numpy build does not create math.pxd[/-] [+]numpy build does not create math.pxd when compiling for armeabi-v7a[/+] on May 10, 2025
  3. changed the title [-]numpy build does not create math.pxd when compiling for armeabi-v7a[/-] [+]numpy build does not create math.pxd[/+] on May 10, 2025
  4. clayote commented on May 10, 2025

    @clayote
    ContributorAuthor

    Do try building on this branch #3136

    I have now tried this, and it doesn't seem to make much difference. Similar log files and buildozer.spec here.

  5. changed the title [-]numpy build does not create math.pxd[/-] [+]numpy build fails for lack of `numpy.math`[/+] on May 10, 2025
  6. clayote commented on May 10, 2025

    @clayote
    ContributorAuthor

    I gather math.pxd is not part of numpy, exactly, but of Cython. Here's the file on the Cython source tree.

  7. clayote commented on May 10, 2025

    @clayote
    ContributorAuthor

    I tried modifying the numpy recipe slightly, to point it at a release tarball of numpy, rather than its git repository; this somehow caused an error even finding meson. I think maybe this points to some deeper issue with MesonRecipe?

  8. mre2m2 commented on May 10, 2025

    @mre2m2

    I'm encountering the same error: 'numpy/math.pxd' not found.
    The build had been working consistently before, and the last successful build was just 3 days ago, without any code changes since.

    It seems that P4A creates an isolated environment and ignores specified version of Cython (==0.29.33) and there is a compatibility issue between newer Cython versions and older Numpy versions.

    attached is my full log, thanks a lot for your help

    0_build.txt

  9. T-Dynamos commented on May 10, 2025

    @T-Dynamos
    Member

    Maybe try pining cython version as:

    hostpython_prerequisites = ["Cython==3.0.6"]  # meson does not detects venv's cython

    (in numpy recipe)

  10. clayote commented on May 10, 2025

    @clayote
    ContributorAuthor

    That seemed to work, thanks @T-Dynamos!

  11. jhay06 commented on Jun 4, 2025

    @jhay06

    how did you fix this error ? , i'm currently facing this issue right now .

  12. clayote commented on Jun 4, 2025

    @clayote
    ContributorAuthor

    Maybe try pining cython version as:

    hostpython_prerequisites = ["Cython==3.0.6"] # meson does not detects venv's cython

    (in numpy recipe)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions