osvenskan / posix_ipc

Other
135 stars 24 forks source link

Compilation terminated while building from wheel #55

Open chourroutm opened 3 days ago

chourroutm commented 3 days ago

Hi, I'm getting a compilation error when installing the package:

(.venv) linux@DESKTOP-3N7Q5KV:~/convert_with_cloudvolume$ pip install posix-ipc
Collecting posix-ipc
  Using cached posix_ipc-1.1.1.tar.gz (94 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: posix-ipc
  Building wheel for posix-ipc (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'posix_ipc' extension
      creating build
      creating build/temp.linux-x86_64-3.11
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/linux/convert_with_cloudvolume/.venv/include -I/usr/include/python3.11 -c posix_ipc_module.c -o build/temp.linux-x86_64-3.11/posix_ipc_module.o
      posix_ipc_module.c:33:10: fatal error: Python.h: No such file or directory
         33 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for posix-ipc
  Running setup.py clean for posix-ipc
Failed to build posix-ipc
Installing collected packages: posix-ipc
  Running setup.py install for posix-ipc ... error
  error: subprocess-exited-with-error

  × Running setup.py install for posix-ipc did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      running install
      /home/linux/convert_with_cloudvolume/.venv/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_ext
      building 'posix_ipc' extension
      creating build
      creating build/temp.linux-x86_64-3.11
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/linux/convert_with_cloudvolume/.venv/include -I/usr/include/python3.11 -c posix_ipc_module.c -o build/temp.linux-x86_64-3.11/posix_ipc_module.o
      posix_ipc_module.c:33:10: fatal error: Python.h: No such file or directory
         33 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> posix-ipc

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I had made the rookie mistake from #50 and installed gcc and clang (maybe there's a conflict now?).

I've checked the file permissions of gcc:

(.venv) linux@DESKTOP-3N7Q5KV:~/convert_with_cloudvolume$ ls -ls /usr/bin/x86_64-linux-gnu-gcc
0 lrwxrwxrwx 1 root root 6 Aug  5  2021 /usr/bin/x86_64-linux-gnu-gcc -> gcc-11
osvenskan commented 2 days ago

Hi @chourroutm, you need to install a package that provides files for Python developers. In my limited Linux experience, this is often called something like python-dev. That package provides Python.h.