OSError: [Errno 62] Too many levels of symbolic links: '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Makefile'
virtualenv env在任何檔案夾中運行時出現此錯誤。python -m virtualenv env除了 python3 的每個版本都回傳此錯誤。
Python3 回傳 dyld[1761]: Library not loaded: @executable_path/../.Python Referenced from: /opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/bin/python3.9 Reason: tried: '/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/bin/../.Python' (no such file), '/usr/local/lib/.Python' (no such file), '/usr/lib/.Python' (no such file)
我正在運行 macOS 12.0 Monterey(如果重要的話,M1 Pro)。
我已經嘗試了一百萬個解決方案,包括關閉 SIP 和嘗試洗掉系統檔案/檔案夾(我無法做到)。我在這里不知所措。卸載并重新安裝 virtualenv 沒有任何作用。
ls -l /usr/bin | grep python 回報
lrwxr-xr-x 1 root wheel 75 18 Sep 09:26 python -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x 1 root wheel 82 18 Sep 09:26 python-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
lrwxr-xr-x 1 root wheel 75 18 Sep 09:26 python2 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x 1 root wheel 75 18 Sep 09:26 python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x 1 root wheel 82 18 Sep 09:26 python2.7-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
-rwxr-xr-x 1 root wheel 137696 18 Sep 09:26 python3
lrwxr-xr-x 1 root wheel 76 18 Sep 09:26 pythonw -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
lrwxr-xr-x 1 root wheel 76 18 Sep 09:26 pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
在嘗試讓 virtualenv 運行 python 2.7 的程序中,我可能已經搞砸了,現在我無法使用任何版本。
在出現此錯誤之前,我在嘗試使用 2.7 作為選項運行 virtualenv 時遇到此錯誤。
No virtualenv implementation for PythonInfo(spec=CPython2.7.16.final.0-64...
uj5u.com熱心網友回復:
經過一番瘋狂的谷歌搜索后,我偶然發現了https://unix.stackexchange.com/questions/39333/how-can-i-remove-all-symbolic-links-with-a-special-target。我跑了ls -la *然后unlink /path/to/Makefile這就像/Library/Frameworks/Python....
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/383876.html
