突然 osxmetadata 损坏了,它已经运行了好几个月,现在我收到了 ModuleNotFoundError: No module named 'osxmetadata'
错误。尝试通过 pip 安装时,我收到 xattr 的构建错误(见下文),这显然是 osxmetadata 的要求。
我如何知道模块现在是如何丢失的?我怎样才能知道发生了什么变化?
我使用的是 Mohave 10.14.6 和 Python 3.9.1。
模块的存储库在这里: https://pypi.org/project/osxmetadata/
感谢任何建议。
Tethys:~ debra$ pip3 install osxmetadata
Collecting osxmetadata
Using cached osxmetadata-0.99.14-py3-none-any.whl (41 kB)
Collecting bitstring==3.1.7
Using cached bitstring-3.1.7-py3-none-any.whl
Collecting py-applescript==1.0.2
Using cached py_applescript-1.0.2-py3-none-any.whl (22 kB)
Collecting pyobjc-framework-AppleScriptObjC==7.2
Using cached pyobjc_framework_AppleScriptObjC-7.2-py2.py3-none-any.whl (3.9 kB)
Requirement already satisfied: pyobjc-core==7.2 in /usr/local/lib/python3.9/site-packages (from osxmetadata) (7.2)
Collecting pyobjc-framework-AppleScriptKit==7.2
Using cached pyobjc_framework_AppleScriptKit-7.2-py2.py3-none-any.whl (3.8 kB)
Collecting xattr==0.9.7
Using cached xattr-0.9.7.tar.gz (13 kB)
Collecting click>=7.0
Using cached click-8.0.1-py3-none-any.whl (97 kB)
Requirement already satisfied: pyobjc-framework-Cocoa>=7.2 in /usr/local/lib/python3.9/site-packages (from pyobjc-framework-AppleScriptKit==7.2->osxmetadata) (7.2)
Requirement already satisfied: cffi>=1.0.0 in /usr/local/lib/python3.9/site-packages (from xattr==0.9.7->osxmetadata) (1.14.5)
Requirement already satisfied: pycparser in /usr/local/lib/python3.9/site-packages (from cffi>=1.0.0->xattr==0.9.7->osxmetadata) (2.20)
Building wheels for collected packages: xattr
Building wheel for xattr (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/0n/32xl4kh15db60dkknjlsx76r0000gr/T/pip-install-hfwc86ib/xattr_3ef19955dd0a44e2acb6e2140161dc5c/setup.py'"'"'; __file__='"'"'/private/var/folders/0n/32xl4kh15db60dkknjlsx76r0000gr/T/pip-install-hfwc86ib/xattr_3ef19955dd0a44e2acb6e2140161dc5c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/0n/32xl4kh15db60dkknjlsx76r0000gr/T/pip-wheel-o2d733rw
cwd: /private/var/folders/0n/32xl4kh15db60dkknjlsx76r0000gr/T/pip-install-hfwc86ib/xattr_3ef19955dd0a44e2acb6e2140161dc5c/
Complete output (24 lines):
Warning: 'classifiers' should be a list, got type 'filter'
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.9
creating build/lib.macosx-10.14-x86_64-3.9/xattr
copying xattr/lib_build.py -> build/lib.macosx-10.14-x86_64-3.9/xattr
copying xattr/compat.py -> build/lib.macosx-10.14-x86_64-3.9/xattr
copying xattr/lib.py -> build/lib.macosx-10.14-x86_64-3.9/xattr
copying xattr/__init__.py -> build/lib.macosx-10.14-x86_64-3.9/xattr
copying xattr/tool.py -> build/lib.macosx-10.14-x86_64-3.9/xattr
copying xattr/pyxattr_compat.py -> build/lib.macosx-10.14-x86_64-3.9/xattr
running build_ext
generating cffi module 'build/temp.macosx-10.14-x86_64-3.9/_lib.c'
creating build/temp.macosx-10.14-x86_64-3.9
building '_lib' extension
creating build/temp.macosx-10.14-x86_64-3.9/build
creating build/temp.macosx-10.14-x86_64-3.9/build/temp.macosx-10.14-x86_64-3.9
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/tcl-tk/include -I/usr/local/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c build/temp.macosx-10.14-x86_64-3.9/_lib.c -o build/temp.macosx-10.14-x86_64-3.9/build/temp.macosx-10.14-x86_64-3.9/_lib.o
xcrun: error: active developer path ("/Volumes/Archive/Xcode-beta.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
error: command '/usr/bin/clang' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for xattr
Running setup.py clean for xattr
Failed to build xattr
Installing collected packages: xattr, pyobjc-framework-AppleScriptObjC, pyobjc-framework-AppleScriptKit, py-applescript, click, bitstring, osxmetadata
Running setup.py install for xattr ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/0n/32xl4kh15db60dkknjlsx76r0000gr/T/pip-install-hfwc86ib/xattr_3ef19955dd0a44e2acb6e2140161dc5c/setup.py'"'"'; __file__='"'"'/private/var/folders/0n/32xl4kh15db60dkknjlsx76r0000gr/T/pip-install-hfwc86ib/xattr_3ef19955dd0a44e2acb6e2140161dc5c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/0n/32xl4kh15db60dkknjlsx76r0000gr/T/pip-record-zazdtdsf/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/xattr
cwd: /private/var/folders/0n/32xl4kh15db60dkknjlsx76r0000gr/T/pip-install-hfwc86ib/xattr_3ef19955dd0a44e2acb6e2140161dc5c/
Complete output (24 lines):
Warning: 'classifiers' should be a list, got type 'filter'
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.9
creating build/lib.macosx-10.14-x86_64-3.9/xattr
copying xattr/lib_build.py -> build/lib.macosx-10.14-x86_64-3.9/xattr
copying xattr/compat.py -> build/lib.macosx-10.14-x86_64-3.9/xattr
copying xattr/lib.py -> build/lib.macosx-10.14-x86_64-3.9/xattr
copying xattr/__init__.py -> build/lib.macosx-10.14-x86_64-3.9/xattr
copying xattr/tool.py -> build/lib.macosx-10.14-x86_64-3.9/xattr
copying xattr/pyxattr_compat.py -> build/lib.macosx-10.14-x86_64-3.9/xattr
running build_ext
generating cffi module 'build/temp.macosx-10.14-x86_64-3.9/_lib.c'
creating build/temp.macosx-10.14-x86_64-3.9
building '_lib' extension
creating build/temp.macosx-10.14-x86_64-3.9/build
creating build/temp.macosx-10.14-x86_64-3.9/build/temp.macosx-10.14-x86_64-3.9
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/tcl-tk/include -I/usr/local/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c build/temp.macosx-10.14-x86_64-3.9/_lib.c -o build/temp.macosx-10.14-x86_64-3.9/build/temp.macosx-10.14-x86_64-3.9/_lib.o
xcrun: error: active developer path ("/Volumes/Archive/Xcode-beta.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
error: command '/usr/bin/clang' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/0n/32xl4kh15db60dkknjlsx76r0000gr/T/pip-install-hfwc86ib/xattr_3ef19955dd0a44e2acb6e2140161dc5c/setup.py'"'"'; __file__='"'"'/private/var/folders/0n/32xl4kh15db60dkknjlsx76r0000gr/T/pip-install-hfwc86ib/xattr_3ef19955dd0a44e2acb6e2140161dc5c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/0n/32xl4kh15db60dkknjlsx76r0000gr/T/pip-record-zazdtdsf/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/xattr Check the logs for full command output.
答案 0 :(得分:0)
来自开发者:
看起来需要构建的 xattr 存在 xcode 问题,并且您安装了可能导致此问题的测试版 xcode。
xcrun: error: active developer path ("/Volumes/Archive/Xcode-beta.app/Contents/Developer") 不存在
以下命令可能会有所帮助:
$ sudo xcode-select -r $ sudo xcode-select --switch /Library/Developer/CommandLineTools 然后: $ sudo xcode-select -p 验证命令行工具路径是否正确