1

I'm using Xcode. I got an error on this new mac: 'Python.h' file not found. At line: #include <Python.h>

When I type sudo find / -name "Python.h" in command line, I can see quite a few version of it exist, even inside Xcode.

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h find: /dev/fd/3: Not a directory find: /dev/fd/4: Not a directory /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h /System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h

Anyone have any idea of what is going on? Is that I am not setting up Xcode properly?

Steven
  • 400
  • 3
  • 11

1 Answers1

2

You need to set the include path where 'Python.h' exists.

For detailed operation, please refer the question "How to set include path in xcode project" at following URL.

How to set include path in xcode project

Community
  • 1
  • 1
Fumu 7
  • 1,091
  • 1
  • 7
  • 8
  • The include path in my old project is '/urs/include/python2.7', but it is no longer there in my new mac. I found the right location at '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/' and added it. Thanks. – Steven Aug 28 '14 at 00:55