mac终端lldb提示 ImportError: cannot

2018-12-27  本文已影响34人  May_Dobin

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

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 52, in <module>
    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 <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref

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

brew list

结果如下:

image.png

解决办法:

  brew remove python@2 --ignore-dependencies

运行lldb验证:

image.png
上一篇 下一篇

猜你喜欢

热点阅读