etiennedub / pyk4a

Python 3 wrapper for Azure-Kinect-Sensor-SDK
MIT License
287 stars 81 forks source link

poetry install issue #219

Closed bgyooPtr closed 5 months ago

bgyooPtr commented 10 months ago

When I try to install pyk4a using poetry, the following error occurs. Is there a solution?

Using version ^1.5.0 for pyk4a

Updating dependencies
Resolving dependencies... (2.1s)

Package operations: 1 install, 0 updates, 0 removals

  • Installing pyk4a (1.5.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  /tmp/tmpi6xkrfjb/.venv/lib/python3.9/site-packages/setuptools/dist.py:498: SetuptoolsDeprecationWarning: Invalid dash-separated options
  !!

          ********************************************************************************
          Usage of dash-separated 'description-file' will not be supported in future
          versions. Please use the underscore name 'description_file' instead.

          This deprecation is overdue, please update your project and remove deprecated
          calls to avoid build errors in the future.

          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************

  !!
    opt = self.warn_dash_deprecation(opt, section)
  Automatic kinect SDK detection did not yield any results.
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-39
  creating build/lib.linux-x86_64-cpython-39/pyk4a
  copying pyk4a/record.py -> build/lib.linux-x86_64-cpython-39/pyk4a
  copying pyk4a/transformation.py -> build/lib.linux-x86_64-cpython-39/pyk4a
  copying pyk4a/results.py -> build/lib.linux-x86_64-cpython-39/pyk4a
  copying pyk4a/pyk4a.py -> build/lib.linux-x86_64-cpython-39/pyk4a
  copying pyk4a/module.py -> build/lib.linux-x86_64-cpython-39/pyk4a
  copying pyk4a/config.py -> build/lib.linux-x86_64-cpython-39/pyk4a
  copying pyk4a/errors.py -> build/lib.linux-x86_64-cpython-39/pyk4a
  copying pyk4a/capture.py -> build/lib.linux-x86_64-cpython-39/pyk4a
  copying pyk4a/playback.py -> build/lib.linux-x86_64-cpython-39/pyk4a
  copying pyk4a/calibration.py -> build/lib.linux-x86_64-cpython-39/pyk4a
  copying pyk4a/__init__.py -> build/lib.linux-x86_64-cpython-39/pyk4a
  copying pyk4a/win32_utils.py -> build/lib.linux-x86_64-cpython-39/pyk4a
  copying pyk4a/py.typed -> build/lib.linux-x86_64-cpython-39/pyk4a
  running build_ext
  building 'k4a_module' extension
  creating build/temp.linux-x86_64-cpython-39
  creating build/temp.linux-x86_64-cpython-39/pyk4a
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/tmp/tmpi6xkrfjb/.venv/lib/python3.9/site-packages/numpy/core/include -I/tmp/tmpi6xkrfjb/.venv/include -I/usr/include/python3.9 -c pyk4a/pyk4a.cpp -o build/temp.linux-x86_64-cpython-39/pyk4a/pyk4a.o
  pyk4a/pyk4a.cpp:1:10: fatal error: Python.h: No such file or directory
      1 | #include <Python.h>
        |          ^~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

  at ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/chef.py:147 in _prepare
      143│ 
      144│                 error = ChefBuildError("\n\n".join(message_parts))
      145│ 
      146│             if error is not None:
    → 147│                 raise error from None
      148│ 
      149│             return path
      150│ 
      151│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with pyk4a (1.5.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "pyk4a (==1.5.0)"'.
lpasselin commented 10 months ago

I have no idea how poetry handles building binaries, sorry

shagren commented 5 months ago
  pyk4a/pyk4a.cpp:1:10: fatal error: Python.h: No such file or directory

Like as you haven't python development package, it is named python3-dev on debian.