Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3690680
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:03:45+00:00 2026-05-19T04:03:45+00:00

Using the Python templates for Xcode, I have a simple project running on one

  • 0

Using the Python templates for Xcode, I have a simple project running on one machine and failing on two others, for different reasons. The failure I solved is that even though main.m has:

Py_SetProgramName("/usr/bin/python");

The actual running Python as seen from main.py with this:

import sys
print sys.version

is different. And the problem was that this other Python didn’t have objc installed. So the question is: short of cleaning up my machine, how can I direct Xcode to use the system Python?

Edit:

This is a problem that seems like it is trivial, but it isn’t. It seems so because when I specify Mac OS X 10.5 as the Base SDK, Xcode links against that Python.framework, as I can see by double-clicking the icon in Linked Frameworks in the Xcode project.

Each Version in Python.framework has a key/value pair in its Info.plist: CFBundleExecutableName/Python. Luckily (for the forensics) this Python in the Version 2.5 framework launches 2.6.1! Yet by printing sys.version (from main.py) or by snooping on the loader (by doing export DYLD_PRINT_LIBRARIES=1), I can see that the PyObjC App actually launches Python 2.5.4.

The line above with Py_SetProgramName.. is irrelevant—it can be commented out and everything works fine.

So what it looks like is that Python.framework controls which Python is launched, it doesn’t do this in the way I expected, and it might be controlled through an initialization routine that is opaque, since it’s controlled by Apple. It seems the best way to “control” the situation is to change the Base SDK.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:03:45+00:00Added an answer on May 19, 2026 at 4:03 am

    Sorry to answer my own question but I was just confused. This part is an error

    Python in the Version 2.5 framework launches 2.6.1

    caused by my not realizing that what’s going on here (from the Version/2.6 directory)

    > ./Python
    -bash: ./Python: cannot execute binary file
    > Python
    Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) 
    

    is that we’re searching my $PATH and launching /opt/local/bin/python.
    Apologies for the confusion.

    To summarize, setting the SDK should get the desired Python to run as we can see by snooping on the loader:

    > export DYLD_PRINT_LIBRARIES=1
    > ~/Desktop/X/build/Debug/X.app/Contents/MacOS/X
    dyld: loaded: /Users/telliott_admin/Desktop/X/build/Debug/X.app/Contents/MacOS/X
    dyld: loaded: /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
    dyld: loaded: /System/Library/Frameworks/Python.framework/Versions/2.5/Python
    ..
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Python I want to be able to draw text at different angles using
When using Python's super() to do method chaining, you have to explicitly specify your
I'm using python and CherryPy to create a simple internal website that about 2
I am using python 2.6 on XP. I have just installed py2exe, and I
I'm using Google App Engine's version of Django templates in Python. Is there a
I am using Jinja2 templates for my GAE Python application. Actually there are a
I'm running Python 2.6.1 and Django 1.2.1 on Windows XP SP3. I'm using JetBrains
Using python 2.4 and the built-in ZipFile library, I cannot read very large zip
Using Python, how would I go about reading in (be from a string, file
Using Python 2.6, is there a way to check if all the items of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.