yanji_88
yanji_88

Reputation: 1

Python debugger in Visual Studio 2022 doesn't work

I'm on Visual Studio Community 2022 (64-bit) ver 17.12.4, and Python 3.13.

I have installed Python development and .NET desktop development.

Code runs properly using "Start Without Debugging," but "Start Debugging" doesn't work.

The following text shows up in the console soon as I press "Start Debugging":

Traceback (most recent call last):
  File "c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\python\core\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 275, in _on_run
    self.process_net_command_json(self.py_db, json_contents)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\python\core\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_process_net_command_json.py", line 219, in process_net_command_json
    cmd = on_request(py_db, request)
  File "c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\python\core\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_process_net_command_json.py", line 532, in on_launch_request
    return self._handle_launch_or_attach_request(py_db, request, start_reason="launch")
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\python\core\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_process_net_command_json.py", line 521, in _handle_launch_or_attach_request
    self._set_debug_options(py_db, request.arguments.kwargs, start_reason=start_reason)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\python\core\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_process_net_command_json.py", line 493, in _set_debug_options
    self.api.stop_on_entry()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\python\core\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_api.py", line 988, in stop_on_entry
    info.update_stepping_info()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\python\core\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_additional_thread_info_regular.py", line 204, in update_stepping_info
    _update_stepping_info(self)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\python\core\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_additional_thread_info_regular.py", line 278, in _update_stepping_info
    if info._get_related_thread() is not None:
       ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\python\core\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_additional_thread_info_regular.py", line 138, in _get_related_thread
    if thread._is_stopped:
       ^^^^^^^^^^^^^^^^^^
AttributeError: '_MainThread' object has no attribute '_is_stopped'

I have tried uninstalling and reinstalling Python, Python development, .NET desktop development, and restarting my device.

I have also followed this which is the same problem as I have. However, even after downloading the debugging symbols and unchecking "Enable native code debugging," the debugger still doesn't work for me.


UPDATE: I have just rolled back my Visual Studio Community 2022 ver from 17.12.4 to 17.10.4 and the debugger started working with the aforementioned solutions.

Upvotes: 0

Views: 35

Answers (1)

yanji_88
yanji_88

Reputation: 1

UPDATE: I have just rolled back my Visual Studio Community 2022 ver from 17.12.4 to 17.10.4 and the debugger started working with the aforementioned solutions.

Upvotes: 0

Related Questions