Skip to content

./local/install_deps_linux.bash missing python3-dev #4901

@ArthurSonzogni

Description

@ArthurSonzogni

When running ./local/install_deps_linux.bash, I get the error:

Logs

Full build error
| Building wheels for collected packages: google-cloud-profiler
|   Building wheel for google-cloud-profiler (pyproject.toml): started
|   Building wheel for google-cloud-profiler (pyproject.toml): finished with status 'error'
|   error: subprocess-exited-with-error
| 
|   × Building wheel for google-cloud-profiler (pyproject.toml) did not run successfully.
|   │ exit code: 1
|   ╰─> [35 lines of output]
|       /tmp/pip-build-env-i2te74he/overlay/lib/python3.11/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
|       !!
| 
|               ********************************************************************************
|               Please consider removing the following classifiers in favor of a SPDX license expression:
| 
|               License :: OSI Approved :: Apache Software License
| 
|               See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
|               ********************************************************************************
| 
|       !!
|         self._finalize_license_expression()
|       running bdist_wheel
|       running build
|       running build_py
|       creating build/lib.linux-x86_64-cpython-311/googlecloudprofiler
|       copying googlecloudprofiler/pythonprofiler.py -> build/lib.linux-x86_64-cpython-311/googlecloudprofiler
|       copying googlecloudprofiler/profile_pb2.py -> build/lib.linux-x86_64-cpython-311/googlecloudprofiler
|       copying googlecloudprofiler/cpu_profiler.py -> build/lib.linux-x86_64-cpython-311/googlecloudprofiler
|       copying googlecloudprofiler/client.py -> build/lib.linux-x86_64-cpython-311/googlecloudprofiler
|       copying googlecloudprofiler/builder.py -> build/lib.linux-x86_64-cpython-311/googlecloudprofiler
|       copying googlecloudprofiler/backoff.py -> build/lib.linux-x86_64-cpython-311/googlecloudprofiler
|       copying googlecloudprofiler/__version__.py -> build/lib.linux-x86_64-cpython-311/googlecloudprofiler
|       copying googlecloudprofiler/__init__.py -> build/lib.linux-x86_64-cpython-311/googlecloudprofiler
|       running build_ext
|       building 'googlecloudprofiler._profiler' extension
|       creating build/temp.linux-x86_64-cpython-311/googlecloudprofiler/src
|       x86_64-linux-gnu-g++ -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -Werror=implicit-function-declaration -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fPIC -Igooglecloudprofiler/src -I/usr/local/google/home/arthursonzogni/.local/share/virtualenvs/clusterfuzz-9c9_bw-f/include -I/usr/include/python3.11 -c googlecloudprofiler/src/_profiler.cc -o build/temp.linux-x86_64-cpython-311/googlecloudprofiler/src/_profiler.o -std=c++11
|       cc1plus: warning: ‘-Werror=’ argument ‘-Werror=implicit-function-declaration’ is not valid for C++
|       googlecloudprofiler/src/_profiler.cc:15:10: fatal error: Python.h: No such file or directory
|          15 | #include <Python.h>
|             |          ^~~~~~~~~~
|       compilation terminated.
|       error: command '/usr/bin/x86_64-linux-gnu-g++' 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 google-cloud-profiler^C

This is because the python3-dev package is not installed, which provides the necessary header files for building Python C extensions.

Solution
The install script should be updated to install the python3-dev package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions