Numpy won't install on pi3b Klipper

Basic Information:

Printer Model: ender 3
MCU / Printerboard: 4.2.7 + raspberry pi3b
klippy.log

hello guys, I’m not able to get numpy installed for measuring resonances… I’m no pro in Linux but I tried to activate the swap file like Klipper doc says but no way to get numpy installed. could you help please?

this command worked fine:
sudo apt install python3-numpy python3-matplotlib libatlas-base-dev

But this is what appears on my ssh screen when I try to install:

hitman@Ender:~ $ ~/klippy-env/bin/pip install -v numpy
Using pip 23.2.1 from /home/hitman/klippy-env/lib/python3.9/site-packages/pip (python 3.9)
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting numpy
  Using cached numpy-1.26.0.tar.gz (15.6 MB)
  Running command pip subprocess to install build dependencies
  Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://www.piwheels.org/simple
  Ignoring setuptools: markers 'python_version >= "3.12"' don't match your environment
  Ignoring colorama: markers 'os_name == "nt"' don't match your environment
  Collecting Cython<3.1,>=0.29.34
    Using cached https://www.piwheels.org/simple/cython/Cython-3.0.2-cp39-cp39-linux_armv7l.whl (10.7 MB)
  Collecting pyproject-metadata>=0.7.1
    Using cached https://www.piwheels.org/simple/pyproject-metadata/pyproject_metadata-0.7.1-py3-none-any.whl (7.4 kB)
  Collecting tomli>=1.0.0
    Using cached https://www.piwheels.org/simple/tomli/tomli-2.0.1-py3-none-any.whl (12 kB)
  Collecting packaging>=19.0 (from pyproject-metadata>=0.7.1)
    Using cached https://www.piwheels.org/simple/packaging/packaging-23.1-py3-none-any.whl (48 kB)
  Installing collected packages: tomli, packaging, Cython, pyproject-metadata
  Successfully installed Cython-3.0.2 packaging-23.1 pyproject-metadata-0.7.1 tomli-2.0.1
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  Getting requirements to build wheel ... done
  Running command pip subprocess to install backend dependencies
  Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://www.piwheels.org/simple
  Collecting ninja>=1.8.2
    Using cached https://www.piwheels.org/simple/ninja/ninja-1.11.1-cp39-cp39-linux_armv7l.whl (132 kB)
  Collecting patchelf>=0.11.0
    Using cached patchelf-0.17.2.1-py2.py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl (381 kB)
  Installing collected packages: patchelf, ninja
  Successfully installed ninja-1.11.1 patchelf-0.17.2.1
  Installing backend dependencies ... done
  Running command Preparing metadata (pyproject.toml)
  + /home/hitman/klippy-env/bin/python /tmp/pip-install-1k2loojo/numpy_ec71125a51df47d5b81c89fc1bf1d5ee/vendored-meson/meson/meson.py setup /tmp/pip-install-1k2loojo/numpy_ec71125a51df47d5b81c89fc1bf1d5ee /tmp/pip-install-1k2loojo/numpy_ec71125a51df47d5b81c89fc1bf1d5ee/.mesonpy-no0y9xnw/build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-install-1k2loojo/numpy_ec71125a51df47d5b81c89fc1bf1d5ee/.mesonpy-no0y9xnw/build/meson-python-native-file.ini
  The Meson build system
  Version: 1.2.99
  Source dir: /tmp/pip-install-1k2loojo/numpy_ec71125a51df47d5b81c89fc1bf1d5ee
  Build dir: /tmp/pip-install-1k2loojo/numpy_ec71125a51df47d5b81c89fc1bf1d5ee/.mesonpy-no0y9xnw/build
  Build type: native build
  Project name: NumPy
  Project version: 1.26.0
  C compiler for the host machine: cc (gcc 10.2.1 "cc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
  C linker for the host machine: cc ld.bfd 2.35.2
  C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
  C++ linker for the host machine: c++ ld.bfd 2.35.2
  Cython compiler for the host machine: cython (cython 3.0.2)
  Host machine cpu family: arm
  Host machine cpu: armv7l
  Program python found: YES (/home/hitman/klippy-env/bin/python)
  Found pkg-config: /usr/bin/pkg-config (0.29.2)
  Run-time dependency python found: YES 3.9
  Has header "Python.h" with dependency python-3.9: YES
  Compiler for C supports arguments -fno-strict-aliasing: YES
  Message: During parsing cpu-dispatch: The following CPU features were ignored due to platform incompatibility or lack of support:
  "XOP FMA4"
  Test features "NEON" : Supported
  Test features "NEON_FP16" : Supported
  Test features "NEON_VFPV4" : Supported
  Test features "ASIMD" : Unsupported due to Compiler fails against the test code of "ASIMD"
  Test features "ASIMDHP" : Unsupported due to Implied feature "ASIMD" is not supported
  Test features "ASIMDFHM" : Unsupported due to Implied feature "ASIMD" is not supported
  Configuring npy_cpu_dispatch_config.h using configuration
  Message:
  CPU Optimization Options
    baseline:
      Requested : min
      Enabled   :
    dispatch:
      Requested : max -xop -fma4
      Enabled   : NEON NEON_FP16 NEON_VFPV4

  Library m found: YES
  Found CMake: /usr/bin/cmake (3.18.4)
  WARNING: CMake Toolchain: Failed to determine CMake compilers state
  Run-time dependency openblas found: NO (tried pkgconfig and cmake)
  Run-time dependency openblas found: NO (tried pkgconfig and cmake)

  ../../numpy/meson.build:207:4: ERROR: Problem encountered: No BLAS library detected! Install one, or use the `allow-noblas` build option (note, this may be up to 100x slower for some linear algebra operations).

  A full log can be found at /tmp/pip-install-1k2loojo/numpy_ec71125a51df47d5b81c89fc1bf1d5ee/.mesonpy-no0y9xnw/build/meson-logs/meson-log.txt
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /home/hitman/klippy-env/bin/python /home/hitman/klippy-env/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpml64xmd_
  cwd: /tmp/pip-install-1k2loojo/numpy_ec71125a51df47d5b81c89fc1bf1d5ee
  Preparing metadata (pyproject.toml) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
1 Like

Try:

~/klippy-env/bin/pip install -v numpy==1.25.2

4 Likes

Thank you so much! numpy 1.25.2 installed successfully!

1 Like

For future reference:

  • v1.2.6 is brand new and no wheels are available
  • Once available, this problem should solve itself
1 Like

Life saver!

Thank you very much! I have spent four days trying to install numpy in my pi4 in vain. How cool it is!