Search code examples
pythonmacosinstallationpyobjc

How to install PyObjC on Python 3.5 (OS X 10.10 Yosemite)?


I am trying to install PyObjC using pip3 install pyobjc-core, on a Mac with Python 3.5 and OS X 10.10.5 (Yosemite). I get the following error message:

Collecting pyobjc-core
  Downloading pyobjc-core-3.1.1.tar.gz (2.2MB)
    100% |████████████████████████████████| 2.2MB 481kB/s 
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/pyobjc_core.egg-info
    writing include/pyobjc-compat.h to pip-egg-info/pyobjc_core.egg-info/include/pyobjc-compat.h
    writing include/pyobjc-api.h to pip-egg-info/pyobjc_core.egg-info/include/pyobjc-api.h
    writing pip-egg-info/pyobjc_core.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/pyobjc_core.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/pyobjc_core.egg-info/dependency_links.txt
    writing namespace_packages to pip-egg-info/pyobjc_core.egg-info/namespace_packages.txt
    writing manifest file 'pip-egg-info/pyobjc_core.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/v0/bzvt8grs6mv33_j13_wdwqs80000gr/T/pip-build-dzm544zy/pyobjc-core/setup.py", line 696, in <module>
        **parse_package_metadata()
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/private/var/folders/v0/bzvt8grs6mv33_j13_wdwqs80000gr/T/pip-build-dzm544zy/pyobjc-core/setup.py", line 371, in run
        egg_info.egg_info.run(self)
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools/command/egg_info.py", line 180, in run
        self.find_sources()
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools/command/egg_info.py", line 207, in find_sources
        mm.run()
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools/command/egg_info.py", line 291, in run
        self.add_defaults()
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools/command/egg_info.py", line 320, in add_defaults
        sdist.add_defaults(self)
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools/command/sdist.py", line 130, in add_defaults
        build_ext = self.get_finalized_command('build_ext')
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/cmd.py", line 299, in get_finalized_command
        cmd_obj.ensure_finalized()
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "/private/var/folders/v0/bzvt8grs6mv33_j13_wdwqs80000gr/T/pip-build-dzm544zy/pyobjc-core/setup.py", line 525, in finalize_options
        universal_newlines=True).strip()
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 629, in check_output
        **kwargs).stdout
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 711, in run
        output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['/usr/bin/xcodebuild', '-version', '-sdk', 'macosx', 'Path']' returned non-zero exit status 1

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/v0/bzvt8grs6mv33_j13_wdwqs80000gr/T/pip-build-dzm544zy/pyobjc-core/

Similar, if I try just to do pip3 install pyobjc, I get a similar trackback, ending with these fatal words:

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/v0/bzvt8grs6mv33_j13_wdwqs80000gr/T/pip-build-432fq8a3/pyobjc-core/

Any hope for me, or is there, for instance, some known incompatibility with the system bundled version of Python?


Solution

  • I am a month late here but the first line of the error is:

    xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

    You need to install the full version of xcode from the app store not just the command line tools. :)