lightweight-human-pose-estimation-3d-demo.pytorch: Setup issue / NumPy headers not found

When I run python setup.py build_ext, I got this issue.

My environment: WSL2: Ubuntu18.04 OpenCV: Install according to this cmake version 3.10.2

ryo-matsuzaka@DESKTOP-5CM12VV:~/lightweight-human-pose-estimation-3d-demo.pytorch$ python setup.py build_ext running build_ext – Found PythonInterp: /home/ryo-matsuzaka/.pyenv/versions/3.5.4/bin/python (found suitable version “3.5.4”, minimum required is “3.5”) CMake Error at CMakeLists.txt:13 (message): NumPy headers not found

– Configuring incomplete, errors occurred! See also “/home/ryo-matsuzaka/lightweight-human-pose-estimation-3d-demo.pytorch/pose_extractor/build/tmp/CMakeFiles/CMakeOutput.log”. Traceback (most recent call last): File “setup.py”, line 72, in <module> cmdclass={‘build_ext’: CMakeBuild}) File “/home/ryo-matsuzaka/.pyenv/versions/3.5.4/lib/python3.5/distutils/core.py”, line 148, in setup dist.run_commands() File “/home/ryo-matsuzaka/.pyenv/versions/3.5.4/lib/python3.5/distutils/dist.py”, line 955, in run_commands self.run_command(cmd) File “/home/ryo-matsuzaka/.pyenv/versions/3.5.4/lib/python3.5/distutils/dist.py”, line 974, in run_command cmd_obj.run() File “/home/ryo-matsuzaka/.pyenv/versions/3.5.4/lib/python3.5/site-packages/setuptools/command/build_ext.py”, line 75, in run _build_ext.run(self) File “/home/ryo-matsuzaka/.pyenv/versions/3.5.4/lib/python3.5/distutils/command/build_ext.py”, line 339, in run self.build_extensions() File “setup.py”, line 63, in build_extensions subprocess.check_call([‘cmake’, ext.cmake_lists_dir] + cmake_args, cwd=tmp_dir) File “/home/ryo-matsuzaka/.pyenv/versions/3.5.4/lib/python3.5/subprocess.py”, line 271, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command ‘[‘cmake’, ‘/home/ryo-matsuzaka/lightweight-human-pose-estimation-3d-demo.pytorch/pose_extractor’, ‘-DCMAKE_BUILD_TYPE=Release’, ‘-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=/home/ryo-matsuzaka/lightweight-human-pose-estimation-3d-demo.pytorch/pose_extractor/build’, ‘-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=/home/ryo-matsuzaka/lightweight-human-pose-estimation-3d-demo.pytorch/pose_extractor/build/tmp’, ‘-DPYTHON_EXECUTABLE=/home/ryo-matsuzaka/.pyenv/versions/3.5.4/bin/python’]’ returned non-zero exit status 1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (6 by maintainers)

Most upvoted comments

Thank you very much! I delete .pyenv directory and create environment using virtualenv as you mentioned above. I could successfully build.

I believe you are still having issues with different Python versions. On Ubuntu libpose_extractor.so is linked against shared python library (/usr/lib/x86_64-linux-gnu/libpython3.6m.so in my case). I also see, that you probably have python3.6 as a system one. So python3-dev package was installed also for 3.6 version. And error log shows, that your environment is using 3.8.8 version. So try to make the proper environment (virtualenv -p /usr/bin/python3.6 venv_pose3d) and use it with this repository.

As I get you are trying to run it in Windows through WSL? If so, I believe it is better to look for WSL-specific paths to include Python.h. You can try to run find / -name "Python.h"(may be long, but will find you correct path to include). In any case you can run the demo as is (without building anything), just run it.