如何解决在Ubuntu 18.04中安装PyObjC的错误

时间:2019-08-25 03:32:51

标签: python pip pyobjc

我尝试使用pip安装PyObjC,但仍然出现错误

  

ERROR: Command errored out with exit status 1: command: /usr/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-819f93sh/pyobjc-framework-ScreenSaver/setup.py'"'"'; __file__='"'"'/tmp/pip-install-819f93sh/pyobjc-framework-ScreenSaver/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info cwd: /tmp/pip-install-819f93sh/pyobjc-framework-ScreenSaver/ Complete output (15 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-819f93sh/pyobjc-framework-ScreenSaver/setup.py", line 21, in <module> extra_link_args=['-framework', 'ScreenSaver']), File "/tmp/pip-install-819f93sh/pyobjc-framework-ScreenSaver/pyobjc_setup.py", line 392, in Extension os_level = get_os_level() File "/tmp/pip-install-819f93sh/pyobjc-framework-ScreenSaver/pyobjc_setup.py", line 206, in get_os_level pl = plistlib.readPlist('/System/Library/CoreServices/SystemVersion.plist') File "/usr/lib/python3.6/plistlib.py", line 162, in readPlist with _maybe_open(pathOrFile, 'rb') as fp: File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/usr/lib/python3.6/plistlib.py", line 120, in _maybe_open with open(pathOrFile, mode) as fp: FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist' ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

2 个答案:

答案 0 :(得分:2)

答案 1 :(得分:1)

尝试:

git clone https://github.com/ronaldoussoren/pyobjc

手动安装:
python3 pyobjc/install.pypython2 pyobjc/install.py或进入目录。