0

sudo pip install pyobjc returns:

      File "/Users/USER/anaconda/lib/python2.7/subprocess.py", line 573, in check_output
        raise CalledProcessError(retcode, cmd, output=output)
    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/48/0c48tlds0knggddqs9lwf5900000gn/T/pip-build-RZEwHr/pyobjc-core

while both

easy_install -U pyobjc

and

python install setup.py install

return

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 "setup.py", line 185, in <module>
    keywords=['Objective-C', 'bridge', 'Cocoa'],

... many more lines of output ... File "/Users/USER/anaconda/lib/python2.7/pickle.py", line 1382, in loads return Unpickler(file).load() File "/Users/USER/anaconda/lib/python2.7/pickle.py", line 858, in load dispatchkey File "/Users/USER/anaconda/lib/python2.7/pickle.py", line 1133, in load_reduce value = func(*args) TypeError: init() takes at least 3 arguments (1 given)

At least a few other people have run into a similar problem: errorr installing pyobjc on Anaconda python on OSX 10.10.2

Has anyone solved it?

Community
  • 1
  • 1
Vincent Laufer
  • 705
  • 10
  • 26

1 Answers1

2

Recent versions of OSX ship with a precompiled PyObjc, if you're able to use the Mac version of Python you should be able to import it: python

Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import objc
>>> objc.__path__
['/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc']
  • Thanks for leading me to this. You appear to be right: i have added to the original post. Do you think I just need to update Xcode? – Vincent Laufer Aug 07 '15 at 15:50
  • 1
    Updating Xcode is probably a good idea. It's also important to make sure the Python version you're using corresponds to the C-compiled library you want to load, in this case PyObjc. When using an installer such as `pip`, `easy_install`, MacPorts or Homebrew, systems paths can be altered which determine where you're machine will look first for various executables and libraries. – Michiel Kauw-A-Tjoe Aug 11 '15 at 08:08
  • I will try this and report back. Thank you. – Vincent Laufer Aug 11 '15 at 18:11