卸载anaconda后的诗歌和Python问题(Mac OS)

brvekthn  于 2024-01-05  发布在  Python
关注(0)|答案(1)|浏览(167)

我最近重新安装了它的M1版本,因为我以前错误地使用了它的英特尔版本(我遵循了official guide)。
我有一些项目,使用诗歌,我以前安装在一个conda环境与pip install poetry。我想在新的conda环境重复这个过程,但我得到以下错误消息:

  1. Building wheels for collected packages: xattr
  2. Building wheel for xattr (pyproject.toml) ... error
  3. error: subprocess-exited-with-error
  4. × Building wheel for xattr (pyproject.toml) did not run successfully.
  5. exit code: 1
  6. ╰─> [21 lines of output]
  7. running bdist_wheel
  8. running build
  9. running build_py
  10. creating build
  11. creating build/lib.macosx-10.9-universal2-cpython-312
  12. creating build/lib.macosx-10.9-universal2-cpython-312/xattr
  13. copying xattr/lib_build.py -> build/lib.macosx-10.9-universal2-cpython-312/xattr
  14. copying xattr/compat.py -> build/lib.macosx-10.9-universal2-cpython-312/xattr
  15. copying xattr/lib.py -> build/lib.macosx-10.9-universal2-cpython-312/xattr
  16. copying xattr/__init__.py -> build/lib.macosx-10.9-universal2-cpython-312/xattr
  17. copying xattr/tool.py -> build/lib.macosx-10.9-universal2-cpython-312/xattr
  18. copying xattr/pyxattr_compat.py -> build/lib.macosx-10.9-universal2-cpython-312/xattr
  19. running build_ext
  20. generating cffi module 'build/temp.macosx-10.9-universal2-cpython-312/_lib.c'
  21. creating build/temp.macosx-10.9-universal2-cpython-312
  22. building '_lib' extension
  23. creating build/temp.macosx-10.9-universal2-cpython-312/build
  24. creating build/temp.macosx-10.9-universal2-cpython-312/build/temp.macosx-10.9-universal2-cpython-312
  25. clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -arch arm64 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12 -c build/temp.macosx-10.9-universal2-cpython-312/_lib.c -o build/temp.macosx-10.9-universal2-cpython-312/build/temp.macosx-10.9-universal2-cpython-312/_lib.o
  26. xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  27. error: command '/usr/bin/clang' failed with exit code 1
  28. [end of output]
  29. note: This error originates from a subprocess, and is likely not a problem with pip.
  30. ERROR: Failed building wheel for xattr
  31. Failed to build xattr
  32. ERROR: Could not build wheels for xattr, which is required to install pyproject.toml-based projects

字符串
我在输入python --version时也得到类似的错误消息:

  1. xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


但是当我输入python3 --version时,我得到:

  1. Python 3.12.1


会很感激你的帮助。谢谢

iswrvxsc

iswrvxsc1#

第一个错误说你缺少xcrun,试着通过运行xcode-select --install来重新安装xcode,看看是否能解决这个问题。

相关问题