python-blosc icon indicating copy to clipboard operation
python-blosc copied to clipboard

Python.h: No such file or directory with build on linux + PyPy3 + latest pip (21.0.1)

Open gst opened this issue 4 years ago • 1 comments

Hi,

I get:

[ 46%] Building C object blosc/CMakeFiles/blosc_extension.dir/blosc_extension.c.o
cd /mnt/data1/home/gregory.starck/pypy3_wheels/blosc-1.10.2/_skbuild/linux-x86_64-3.6/cmake-build/blosc && /usr/bin/cc -Dblosc_extension_EXPORTS -I/mnt/data1/home/gregory.starck/pypy3_wheels/blosc-1.10.2/blosc/c-blosc/blosc -I/mnt/data1/home/gregory.starck/.virtualenvs/pypy3/include -I/mnt/data1/home/gregory.starck/pypy3_wheels/blosc-1.10.2/blosc/c-blosc/internal-complibs/lz4-1.9.3 -I/mnt/data1/home/gregory.starck/pypy3_wheels/blosc-1.10.2/blosc/c-blosc/internal-complibs/zlib-1.2.8 -I/mnt/data1/home/gregory.starck/pypy3_wheels/blosc-1.10.2/blosc/c-blosc/internal-complibs/zstd-1.4.8 -I/mnt/data1/home/gregory.starck/pypy3_wheels/blosc-1.10.2/blosc/c-blosc/internal-complibs/zstd-1.4.8/common  -O3 -DNDEBUG -fPIC   -o CMakeFiles/blosc_extension.dir/blosc_extension.c.o   -c /mnt/data1/home/gregory.starck/pypy3_wheels/blosc-1.10.2/blosc/blosc_extension.c
/mnt/data1/home/gregory.starck/pypy3_wheels/blosc-1.10.2/blosc/blosc_extension.c:11:10: fatal error: Python.h: No such file or directory
 #include "Python.h"
          ^~~~~~~~~~
compilation terminated.
make[2]: *** [blosc/CMakeFiles/blosc_extension.dir/build.make:63: blosc/CMakeFiles/blosc_extension.dir/blosc_extension.c.o] Error 1
make[2]: Leaving directory '/mnt/data1/home/gregory.starck/pypy3_wheels/blosc-1.10.2/_skbuild/linux-x86_64-3.6/cmake-build'
make[1]: *** [CMakeFiles/Makefile2:158: blosc/CMakeFiles/blosc_extension.dir/all] Error 2
make[1]: Leaving directory '/mnt/data1/home/gregory.starck/pypy3_wheels/blosc-1.10.2/_skbuild/linux-x86_64-3.6/cmake-build'
make: *** [Makefile:152: all] Error 2
Traceback (most recent call last):
  File "/mnt/data1/home/gregory.starck/.virtualenvs/pypy3/site-packages/skbuild/setuptools_wrap.py", line 589, in setup
    cmkr.make(make_args, env=env)
  File "/mnt/data1/home/gregory.starck/.virtualenvs/pypy3/site-packages/skbuild/cmaker.py", line 507, in make
    os.path.abspath(CMAKE_BUILD_DIR())))

An error occurred while building with CMake.
  Command:
    cmake --build . --target install --config Release --
  Source directory:
    /mnt/data1/home/gregory.starck/pypy3_wheels/blosc-1.10.2
  Working directory:
    /mnt/data1/home/gregory.starck/pypy3_wheels/blosc-1.10.2/_skbuild/linux-x86_64-3.6/cmake-build
Please see CMake's output for more information.
(pypy3) bayer ✘-1 ~/pypy3_wheels/blosc-1.10.2 

when trying to build the wheel (python setup.py bdist_wheel) under Ubuntu 20.04 and PyPy3 ..

any idea ?

gst avatar Feb 15 '21 12:02 gst

I workaround by forcing/setting the -DCMAKE_CXX_FLAGS to -I/usr/lib/pypy3/include in the setup.py

gst avatar Feb 15 '21 13:02 gst

Glad that you have found a workaround.

FrancescAlted avatar Dec 07 '22 17:12 FrancescAlted