Search code examples
xcodexcode7python-3.5

How to choose python 3.5.1 executable for project on Xcode 7?


I want to set up a python 3 project in Xcode, but I fail in the step where I'm asked to choose an executable for the scheme. See step 16 in the answer to Python in Xcode 4+?.

I use "which python3" to locate the executable:

$ which python3
/usr/local/bin/python3

but Xcode does not let me choose python3 from "/usr/local/bin" by clicking on it:

enter image description here

If I try following the suggestion of trojanfoe below to uncover the symbolic link through: ls -l /usr/local/bin/python3 I get to "../Cellar/python3/3.5.1/bin/python3" which in turn is a symbolic link pointing to "../Frameworks/Python.framework/Versions/3.5/bin/python3" which finally points at "Python3.5" in that directory. However, my Xcode also is not willing to let me select this file:

enter image description here

I'm running Xcode 7.3.1 in OS X 10.11.4. I've installed python 3.5.1 with home-brew.


Solution

  • In the file selection window right-click on python3.5 and select quick look. Close the quick look window and python3.5 will become selectable. (images attached show workflow referencing the newer python3.6 - it is the same for all python releases).

    Right click on python executable

    Pop up window will be shown

    Select quicklook

    Python executable has been selectable and "choose" button is clickable