Skip to content

Python Debugger - debugpy not supporting Python 3.7 and failing with import error after latest update #1726

@DikshaMakkar

Description

@DikshaMakkar

Environment data

  • debugpy version: v2024.12.0
  • OS and version: Windows 10 - 22H2
  • Python version: Tried both - Python 3.7.16, Python 2.7.18
  • Using VS Code or Visual Studio: VS Code

Actual behavior

On Run and Debug, main.py file should execute through launch.json, but its giving error: "from typing import Tuple, Literal" and getting timed out waiting for debugee to spawn.
Image

Error logs:

Traceback (most recent call last): File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/glue_user/.vscode-server/extensions/ms-python.debugpy-2024.12.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 69, in <module> from debugpy.server import cli File "/home/glue_user/.vscode-server/extensions/ms-python.debugpy-2024.12.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/__init__.py", line 7, in <module> import debugpy._vendored.force_pydevd # noqa File "/home/glue_user/.vscode-server/extensions/ms-python.debugpy-2024.12.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/_vendored/force_pydevd.py", line 51, in <module> 'pydevd', File "/home/glue_user/.vscode-server/extensions/ms-python.debugpy-2024.12.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/_vendored/__init__.py", line 126, in preimport import_module(name) File "/usr/lib64/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/home/glue_user/.vscode-server/extensions/ms-python.debugpy-2024.12.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/pydevd.py", line 228, in <module> from _pydevd_bundle.pydevd_plugin_utils import PluginManager File "/home/glue_user/.vscode-server/extensions/ms-python.debugpy-2024.12.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_plugin_utils.py", line 4, in <module> from typing import Tuple, Literal ImportError: cannot import name 'Literal' from 'typing' (/usr/lib64/python3.7/typing.py)

Expected behavior

On Run and Debug, main.py file should execute through launch.json.

Steps to reproduce:

  1. Open Visual Studio Code, go to the Extensions sidebar.
  2. Ensure that the extension is updated to the latest available version - v2024.12.0.
  3. Open the project folder in VS Code where you intend to run or debug your Python code.
  4. In the VS Code Run and Debug panel, start a debugging session by selecting your configuration and pressing Start Debugging.
  5. Observe any errors in the Debug Console or terminal that may indicate issues with the debugpy dependency, such as the ImportError: cannot import name 'Literal' from 'typing'.

Note:

  • This extension is supported for all actively supported versions of the Python language (i.e., Python >= 3.7).
  • Earlier version of debugpy like - v2024.10.0 are working as expected.

Metadata

Metadata

Assignees

Labels

designIssue is how the product is designedneeds reproIssue has not been reproduced yet

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions