mac终端lldb提示 ImportError: cannot import name _remove_dead_weakref

mac电脑运行lldb 出现下面错误:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 52, in 
    import weakref
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/weakref.py", line 14, in 
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref

发现是python@2的原因,记得之前系统自带是有python,曾经用brew安装过python,查看

brew list

结果如下:

mac终端lldb提示 ImportError: cannot import name _remove_dead_weakref_第1张图片
image.png

解决办法:

  brew remove python@2 --ignore-dependencies

运行lldb验证:

image.png

你可能感兴趣的:(mac终端lldb提示 ImportError: cannot import name _remove_dead_weakref)