【发布时间】:2022-01-12 16:52:10
【问题描述】:
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/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/bin/python3.9 Reason: tried: '/opt/homebrew/Cellar/python@3.9/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...
【问题讨论】:
标签: python macos python-2.7 virtualenv apple-m1