AttributeError:dlsym(RTLD_默认值,AttachDebuggerTracing):未找到符号

2024-06-16 11:24:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在vs代码(MacOSBigSur)中使用调试器,但没有成功。 我在m1 macbook air上。vs代码内部版本。 我尝试了所有这些python解释器:

3.9.6-/opt/homebrew/bin/python3 3.9.1-/usr/local/bin/python3 3.8.2-/usr/bin/python3 2.7.16-/usr/bin/python

我已经尝试使用这个launch.json文件:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }
    ]
}

这是我经常遇到的错误:

 /usr/bin/env /usr/local/bin/python3 /Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/launcher 50295 -- /Users/arch0n/Desktop/py-w3schools/2.py 
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/__main__.py", line 45, in <module>
    cli.main()
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main
    run()
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 267, in run_file
    start_debugging(target)
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 257, in start_debugging
    debugpy.connect(options.address, access_token=options.adapter_access_token)
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/common/compat.py", line 208, in kwonly_f
    return f(*args, **kwargs)
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/__init__.py", line 135, in connect
    return api.connect(address, access_token=access_token)
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/api.py", line 143, in debug
    log.reraise_exception("{0}() failed:", func.__name__, level="info")
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/api.py", line 141, in debug
    return func(address, settrace_kwargs, **kwargs)
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/api.py", line 276, in connect
    _settrace(host=host, port=port, client_access_token=access_token, **settrace_kwargs)
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/api.py", line 47, in _settrace
    return pydevd.settrace(*args, **kwargs)
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py", line 2696, in settrace
    _locked_settrace(
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py", line 2819, in _locked_settrace
    py_db.enable_tracing(py_db.trace_dispatch, apply_to_all_threads=True)
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py", line 1039, in enable_tracing
    pydevd_tracing.SetTrace(thread_trace_func)
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd_tracing.py", line 83, in SetTrace
    if set_trace_to_threads(tracing_func, thread_idents=[thread.get_ident()], create_dummy_thread=False) == 0:
  File "/Users/arch0n/.vscode-insiders/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd_tracing.py", line 349, in set_trace_to_threads
    result = lib.AttachDebuggerTracing(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 387, in __getattr__
    func = self.__getitem__(name)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 392, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, AttachDebuggerTracing): symbol not found

arch0n是我的用户目录


Tags: inpyliblineextensionsvscodeusersfile
2条回答

降级到ms-python.python v2021.6.944021595有效。 我使用了Python扩展中的卸载菜单 并选择了v2021.6.944021595

我通过回滚到先前版本的ms-python.python扩展修复了相同的问题。问题似乎在扩大,尚未得到解决

相关问题 更多 >