Python.framework is missing from OS X 10.9 SDK. Why? Also: Workaround? Python.framework is missing from OS X 10.9 SDK. Why? Also: Workaround? xcode xcode

Python.framework is missing from OS X 10.9 SDK. Why? Also: Workaround?


There was an official Apple support page on the subject:

Changes To Embedding Python Using Xcode 5.0

Basically, what they say is that the method for integrating with Python with the SDK Python.framework is deprecated, and the standard *nix method of using the python.h header should be used instead.

That is (the instructions below are a summary - please look into the linked article for more details):

  1. Replace #include <Python/Python.h> with #include <Python.h>;
  2. Include the Python header location in the header search path;
  3. Remove Python.framework from the project build;
  4. Add the python .dylib file to Xcode;

As for the rationale, they do not detail it, they simply mention that:

Because Python is a framework, it also resides in the SDK, even though Python (or any scripting language) has difficulties being in two places. Due to both long-term and recent issues, it was decided to remove Python from the SDK.


I ran into (and solved) this problem as well:

/bin/sh ../libtool --silent --tag=CC  --mode=link gcc  -I../include -I../ -g -O2 -Wall \    -isysroot <blah>/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk \    -Wl,-F/System/Library/Frameworks \    -framework Python \    -u _PyMac_Error \    -o libdnet.la -\     rpath /usr/local/lib *.lo

The things that jumped out to me initially were that the gnu libtool I was using had done the -Wl flag append on the front of the -F. So, I added

     -F/System/Library/Frameworks     -L/System/Library/Frameworks (just to be safe)

Then, the other thing that was pretty obvious was that '-framework Python' didn't have the .framework suffix like usual. So, I added that as well

      -framework Python.framework

I still couldn't get things to work. Then I figured out what it was:

Long story short, and I don't know why it works or why they changed anything, and I'm particularly miffed that the Python.framework isn't in the SDK anymore (Granted, it was always weird linking to it, but it'll take me a while to retrain myself..

-framework just needs to be changed to -f

Bonus round, there's a Python system wide settings object, as well as the 'python-config' CLI program that will need to be fixed so they don't propogate this bad setting any more.


Looks like Python.framework has been intentionally removed by Apple:

https://developer.apple.com/library/mac/releasenotes/General/APIDiffsMacOSX10_9/index.html

The 10.9 API diff document from Apple shows it has been removed.