If you happen to clear out the project info in an Xcode project and want to build against an external executable (e.g. Python), you need to edit the Product Scheme to put that information back.
Unfortunately, Xcode doesn’t allow you to type in a path, only to use the system file dialog. It will take a long time to navigate to usr/bin/python without either unhiding all files, or using a little trick.
In the Finder, use Go to navigate to usr/bin and then expand the view to see the directory tree (show items as columns). Drag the ‘bin’ folder into the sidebar. You can then navigate to the Python executable from the sidebar in the system folder.