Python.h header file missing on Mac OS X 10.6
I’m trying to access a shared C library in Python with
ctypes on Mac OS X 10.6.8 with Python 2.7.4. To do this, I need to
#include <Python.h> in my C code. If I try to compile a C script that only has that one include statement in it, call it “sample.c”, I get:
$ gcc -shared -o sample.so sample.c sample.c:1:20: error: Python.h: No such file or directory
Since I’m running Mac 10.6, I have Xcode 3.2.6, the latest version available on this iteration of OS X without paying to upgrade to 10.7 and getting Xcode 4. Is there a way to get the Python header file without upgrading my OS?
- Xcode 4.3.3 can't find any header files
- How to add Objective-C Bridging Header entry?
- Xcode Not Immediately Recognizing New Classes (iOS)
- Objective C to Swift header file with multiple targets
- How to have CMake show headers-that are not part of any binary target-in the IDE?
- How to make Xcode find file FacebookSDK.h?
2 Solutions Collect From Internet About “Python.h header file missing on Mac OS X 10.6”
Python is a framework on Mac OS X so you need to,
You also need to call
gcc with the
-framework argument to actually do anything inside C,
gcc -shared -o sample.so sample.c -framework Python
I’m not sure about 10.6.8, but
Python.h should be in
if you installed the official python.org binary. Try adding
gcc command and see if that works.
- Fetching user details from Facebook in iOS
- Break on EXC_BAD_ACCESS in XCode?
- error after updating the Xcode to 7.0
- Calling Swift from C
- When is a NSURLResponse not a NSHTTPURLResponse?
- Xcode 4: Auto-complete & Jump to Definition broken in my Xcode 3 Project
- how to add and retrieve data from plist programmatically
- Offscreen UITextView invisible/clear text in iOS 5
- Read static property from object
- Publishing to TestFlight, new testers, do I really need to rebuild/download my provisioning profile?
- What is the file system on iphone?
- How do you release an MTAudioProcessingTap?
- EKEvent with eventWithIdentifier on iOS