0

I try to import <Python.h> in my C++ code. But there is always an error message telling me: 'Python.h' file not found. I'm pretty sure I have installed python. And, since the compiler I am using is Xcode, I also downloaded the Xcode command line tools. Finally, in order to find where python.h is, I even used the find command to search all folders, but the result is "find: Python.h: No such file or directory"

I have tried various methods I can find online. One of them says to use the framework and library of Xcode itself, I don't know if this is correct(shown in pic), but it doesn't work as it should.enter image description here

  • have you installed python-dev? – Sembei Norimaki Nov 15 '22 at 10:23
  • @SembeiNorimaki According to https://stackoverflow.com/questions/32578106/how-to-install-python-devel-in-mac-os, "If you install Python using brew, the relevant headers are already installed for you.". I have installed brew and used this to install python once, then I should already have the part I need. But in fact, no, I still can't find python.h – LoveSherlock Nov 15 '22 at 11:15

0 Answers0