我试图在使用Python 3.5和OS X 10.10.5(Yosemite)的Mac上使用pip3 install pyobjc-core
安装PyObjC。我收到以下错误消息:
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/
类似地,如果我尝试做
pip3 install pyobjc
,则会得到类似的引用,以这些致命的单词结尾: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/
对我来说有什么希望,或者例如与系统捆绑版本的Python存在某种已知的不兼容性?
最佳答案
我在这里迟到了一个月,但错误的第一行是:xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
您需要从应用程序商店安装完整版本的xcode,而不仅仅是命令行工具。 :)