尝试安装PyObjC时出错

时间:2015-04-18 15:35:21

标签: python-2.7 osx-mavericks pickle pyobjc

我正在尝试使用easy_install PyObjC在我的OSx Mavericks上安装PyObjC,但我一直收到错误

Traceback (most recent call last):
  File "/usr/local/bin/easy_install", line 8, in <module>
    load_entry_point('setuptools==12.2', 'console_scripts', 'easy_install')()
  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 2244, in main

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 374, in run

  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 623, in easy_install

  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 658, in install_item

  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 703, in process_distribution

  File "build/bdist.macosx-10.9-intel/egg/pkg_resources/__init__.py", line 799, in resolve
  File "build/bdist.macosx-10.9-intel/egg/pkg_resources/__init__.py", line 1049, in best_match
  File "build/bdist.macosx-10.9-intel/egg/pkg_resources/__init__.py", line 1061, in obtain
  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 623, in easy_install

  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 653, in install_item

  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 838, in install_eggs

  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 1066, in build_and_install

  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 1052, in run_setup

  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 240, in run_setup
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 193, in setup_context
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 164, in save_modules
  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 139, in resume
  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 152, in save_modules
  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 193, in setup_context
  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 237, in run_setup
  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 267, in run
  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 236, in runner
  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 46, in _execfile
  File "/tmp/easy_install-x4iAnm/pyobjc-framework-Social-3.0.4/setup.py", line 27, in <module>
  File "/tmp/easy_install-x4iAnm/pyobjc-framework-Social-3.0.4/pyobjc_setup.py", line 460, in setup
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 112, in setup
    _setup_distribution = dist = klass(attrs)
  File "build/bdist.macosx-10.9-intel/egg/setuptools/dist.py", line 265, in __init__
  File "build/bdist.macosx-10.9-intel/egg/setuptools/dist.py", line 310, in fetch_build_eggs
  File "build/bdist.macosx-10.9-intel/egg/pkg_resources/__init__.py", line 799, in resolve
  File "build/bdist.macosx-10.9-intel/egg/pkg_resources/__init__.py", line 1049, in best_match
  File "build/bdist.macosx-10.9-intel/egg/pkg_resources/__init__.py", line 1061, in obtain
  File "build/bdist.macosx-10.9-intel/egg/setuptools/dist.py", line 377, in fetch_build_egg
  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 623, in easy_install

  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 653, in install_item

  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 838, in install_eggs

  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 1066, in build_and_install

  File "build/bdist.macosx-10.9-intel/egg/setuptools/command/easy_install.py", line 1052, in run_setup

  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 240, in run_setup
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 193, in setup_context
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 164, in save_modules
  File "build/bdist.macosx-10.9-intel/egg/setuptools/sandbox.py", line 138, in resume
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1382, in loads
    return Unpickler(file).load()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 858, in load
    dispatch[key](self)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1133, in load_reduce
    value = func(*args)
TypeError: __init__() takes at least 3 arguments (1 given)

我默认使用Python 2.7。

1 个答案:

答案 0 :(得分:0)

从它的外观来看,您使用的是Mavericks附带的默认Python,它随附了一个已编译的PyObjC库。我最近升级到优胜美地,但你应该能够导入PyObjC并找到这样的路径:

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']

我最好的猜测是,你所看到的错误是最新的PyObjC和Mavericks下安装的Pickle版本之间的冲突。