美文网首页
mac终端lldb提示 ImportError: cannot

mac终端lldb提示 ImportError: cannot

作者: May_Dobin | 来源:发表于2018-12-27 20:58 被阅读34次

    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

    相关文章

      网友评论

          本文标题:mac终端lldb提示 ImportError: cannot

          本文链接:https://www.haomeiwen.com/subject/vmjdlqtx.html