Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setup issue / NumPy headers not found

See original GitHub issue

When I run python 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 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 “”, line 72, in <module> cmdclass={‘build_ext’: CMakeBuild}) File “/home/ryo-matsuzaka/.pyenv/versions/3.5.4/lib/python3.5/distutils/”, line 148, in setup dist.run_commands() File “/home/ryo-matsuzaka/.pyenv/versions/3.5.4/lib/python3.5/distutils/”, line 955, in run_commands self.run_command(cmd) File “/home/ryo-matsuzaka/.pyenv/versions/3.5.4/lib/python3.5/distutils/”, line 974, in run_command File “/home/ryo-matsuzaka/.pyenv/versions/3.5.4/lib/python3.5/site-packages/setuptools/command/”, line 75, in run File “/home/ryo-matsuzaka/.pyenv/versions/3.5.4/lib/python3.5/distutils/command/”, line 339, in run self.build_extensions() File “”, 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/”, 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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:20 (6 by maintainers)

github_iconTop GitHub Comments

ryo-matsuzakacommented, May 11, 2021

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

Daniil-Osokincommented, May 10, 2021

I believe you are still having issues with different Python versions. On Ubuntu is linked against shared python library (/usr/lib/x86_64-linux-gnu/ 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web cannot find numpy headers - Stack Overflow
On my system the header file is at /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h , so the solution is to ...
Read more >
NumPy headers not found on OS X · Issue #43 - GitHub
The headers are only needed for compiling C stuff using NumPy, so it is possible that wheels (which you download via pip) don't...
Read more >
Should we install numpy headers in /usr/include instead?
I have no problem moving them with proper justification though, so feel free to reopen if there's a compelling reason to do so....
Read more >
Packaging (numpy.distutils) — NumPy v1.24 Manual
If a file is not found in the subpackage_path, then a default ... path(s) to header file(s) where python includedir suffix will...
Read more >
Python GDAL package missing header file when installing via ...
The problem with the pip installing gdal is that it only gets the bindings, not the entire library, so it ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found