Python.h not found in pip install

Continuing the discussion from Python package installation, fails to find Python.h:

This fix no longer works with 2022.2.0, Can someone help? Specifically, with pydensecrf it fails.

1 Like

Upon further investigation, this appears with any C++ -based pip package that require gcc that I have tried.

1 Like

Need to investigate more on a proper fix but one solution is to change all instances of /builds/omniverse/externals/python-build/_build/repopackageroot in kit/python to /PATH/TO/.local/share/ov/pkg/prod-isaac_sim-2022.2.0/kit/python

During the build failures I see the repopackageroot path being used

  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ipydensecrf/densecrf/include -Ipydensecrf -I/builds/omniverse/externals/python-build/_build/repopackageroot/include/python3.7m -c pydensecrf/eigen.cpp -o build/temp.linux-x86_64-cpython-37/pydensecrf/eigen.o
  pydensecrf/eigen.cpp:28:10: fatal error: Python.h: No such file or directory
   #include "Python.h"

After changing all instances of that path it built correctly

./ -m pip install git+
Collecting git+
  Cloning to /tmp/pip-req-build-4mrhip6i
  Running command git clone -q /tmp/pip-req-build-4mrhip6i
  Resolved to commit 0d53acbcf5123d4c88040fe68fbb9805fc5b2fb9
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: pydensecrf
  Building wheel for pydensecrf (PEP 517) ... done
  Created wheel for pydensecrf: filename=pydensecrf-1.0rc2-cp37-cp37m-linux_x86_64.whl size=2907379 sha256=169066512c9354dfeddfcffc891cf89369c2fe8b63df8a31507a10bada528b23
  Stored in directory: /tmp/pip-ephem-wheel-cache-aqykba8_/wheels/c1/7e/80/99adc0b2f215180486e24dd9c700028343ba5f566514a0ef05
Successfully built pydensecrf
Installing collected packages: pydensecrf
Successfully installed pydensecrf-1.0rc2
1 Like

Thanks, this helps.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.