pimoroni / weatherhat-python

MIT License
24 stars 16 forks source link

Preparing metadata (pyproject.toml) did not run successfully. (release 1.0.0) (maybe NUMPY 2.0.0 problem) #32

Closed bsimmo closed 4 months ago

bsimmo commented 4 months ago

Just setting up a nice new PiZero 2 using 32bit bookworm (lite) because I had a nice email this new version had been released :-)

Using Raspberry Connect - terminal to do all the remote stuff, but used SSH before that. Only other extra program installed is git itself (it's not installed by default on lite) and of course RPi Connect

Just flagging this up, could be your problem, or it might not be. I get the error twice, first in initial setup and then when it tries to get example dependencies.

Is this because Numpy is too new (2.0.0 has only just been released six days ago, 17th Jun 2024)

Collecting numpy
  Using cached numpy-2.0.0.tar.gz (18.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      + /home/weatherhat/.virtualenvs/pimoroni/bin/python /tmp/pip-install-5hg1d__a/numpy_e78cb89d51894ade9e9e7577acd5bf6e/vendored-meson/meson/meson.py setup /tmp/pip-install-5hg1d__a/numpy_e78cb89d51894ade9e9e7577acd5bf6e /tmp/pip-install-5hg1d__a/numpy_e78cb89d51894ade9e9e7577acd5bf6e/.mesonpy-487gv4t1 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-install-5hg1d__a/numpy_e78cb89d51894ade9e9e7577acd5bf6e/.mesonpy-487gv4t1/meson-python-native-file.ini
      The Meson build system
      Version: 1.2.99
      Source dir: /tmp/pip-install-5hg1d__a/numpy_e78cb89d51894ade9e9e7577acd5bf6e
      Build dir: /tmp/pip-install-5hg1d__a/numpy_e78cb89d51894ade9e9e7577acd5bf6e/.mesonpy-487gv4t1
      Build type: native build
      Project name: NumPy
      Project version: 2.0.0
      C compiler for the host machine: cc (gcc 12.2.0 "cc (Raspbian 12.2.0-14+rpi1) 12.2.0")
      C linker for the host machine: cc ld.bfd 2.40
      C++ compiler for the host machine: c++ (gcc 12.2.0 "c++ (Raspbian 12.2.0-14+rpi1) 12.2.0")
      C++ linker for the host machine: c++ ld.bfd 2.40
      Cython compiler for the host machine: cython (cython 3.0.10)
      Host machine cpu family: arm
      Host machine cpu: armv7l
      Program python found: YES (/home/weatherhat/.virtualenvs/pimoroni/bin/python)
      Found pkg-config: /usr/bin/pkg-config (1.8.1)
      Run-time dependency python found: YES 3.11
      Has header "Python.h" with dependency python: NO

      ../meson.build:44:2: ERROR: Problem encountered: Cannot compile `Python.h`. Perhaps you need to install python-dev|python-devel

      A full log can be found at /tmp/pip-install-5hg1d__a/numpy_e78cb89d51894ade9e9e7577acd5bf6e/.mesonpy-487gv4t1/meson-logs/meson-log.txt
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
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.
⚠ WARNING: ^^^ 😬 previous command did not exit cleanly!
bsimmo commented 4 months ago

It seems PiWheels cannot cope with NUMPY 2.0.0 on Python 3.11 either, hence it's trying to build. https://www.piwheels.org/project/numpy/

bsimmo commented 4 months ago

So NUMPY 2.0.0 is fixed on Piwheels now https://github.com/piwheels/packages/issues/456 Ben fixed it for us.

Sorted, all installs fine.