2023年9月

在进行macOS嵌入式调试的时候,用gdbserver报错 使用pyenv安装2.7之后同样无果,后使用安装包安装解决

dyld[675]: Library not loaded: /System/Library/Frameworks/Python.framework/Versions/2.7/Python
  Referenced from: <26C16900-9C5F-32FC-9593-0458A2B42E1C> /Users/mac/dev/arm-unknown-linux-gnueabihf/bin/arm-unknown-linux-gnueabihf-gdb
  Reason: tried: '/System/Library/Frameworks/Python.framework/Versions/2.7/Python' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/System/Library/Frameworks/Python.framework/Versions/2.7/Python' (no such file), '/System/Library/Frameworks/Python.framework/Versions/2.7/Python' (no such file, not in dyld cache), '/Library/Frameworks/Python.framework/Versions/2.7/Python' (no such file)

copied from: https://blog.shahednasser.com/how-to-install-python-2-on-mac-12-3/

As of macOS 12.3+, Python 2 which was installed by default at /usr/bin/python have been removed. This can lead to a lot of issues for developers that need to use Python 2 or that use other tools that depend on it.

Install Python 2 To install Python2 again, simply download the macOS universal installer from Python's website

After downloading the installer run it to install Python 2. This will automatically install Python in /usr/local/python as well.

Test it Out You can run Python 2 in your terminal now and other tools using it will no longer have issues:

python