question-mark
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 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

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
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.

1reaction
Daniil-Osokincommented, May 10, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

setup.py 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 setup.py 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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found