Search code examples
pythonxcodemacossdkosx-mavericks

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


System:

  • OS X Mavericks 10.9 13A603
  • Xcode Version 5.0.1 (5A2053)

Problem:

Python.framework seems to be missing from Xcode's 10.9 SDK.

Python.framework exists in the Xcode 10.8 SDK:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework

However, it is missing from my Xcode 10.9 SDK here:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/

This is odd, because Python.framework is still available to users on 10.9 systems here:

/System/Library/Frameworks/Python.framework

Has Python.framework been intentionally removed from the 10.9 SDK? Is this a not-so-subtle hint from Apple to stop using this framework? Or am I just confused?

Notes:

This matters because I have a OS X application which links against Python.framework. It seems I cannot build my application with a Base SDK build setting of 10.9 since Python.framework is missing, and I must link to it.

I am interested in both explanations for why this framework is missing (or why I'm wrong and it's actually not missing), as well as suggestions for workarounds.


Solution

  • 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.