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?

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.