Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger fails to launch in Python3.7 environment on v2024.12.0: cannot import name 'Literal' from 'typing' #489

Closed
vasan-agrostar opened this issue Oct 22, 2024 · 2 comments
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@vasan-agrostar
Copy link

Operating system: MacOS Sonoma 14.6.1
VS Code:
Version: 1.94.2
Commit: 384ff7382de624fb94dbaf6da11977bba1ecd427
Date: 2024-10-09T16:08:44.566Z (1 wk ago)
Electron: 30.5.1
ElectronBuildId: 10262041
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.6.0

After upgrading the VS code extension to v2024.12.0, the debugger fails to launch in my Python 3.7 environment.

The following relevant extensions are installed in my virtual env, but I don't think they matter, as seems to be loading it from the global environment.

typing==3.7.4
typing-extensions==3.7.4

The error I get is:

...
File "/Users/vasan.subramanian/.vscode/extensions/ms-python.debugpy-2024.12.0-darwin-arm64/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' (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/typing.py

I had to revert to debugpy v2024.10.0 to be able to debug my programs.

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Oct 22, 2024
@karthiknadig
Copy link
Member

@vasan-agrostar Python 3.7 has been deprecated for over a year. If you have to use python 3.7 you can pin the extension to an older version, see here for a compatibility: https://github.com/microsoft/vscode-python-debugger?tab=readme-ov-file#limited-support-for-deprecated-python-versions

@karthiknadig karthiknadig closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
@vasan-agrostar
Copy link
Author

But the extension says version 3.7 is supported:

Image

Can we at least update the documentation if it is really deprecated? Also, when trying to run using python 3.6, it shows a message saying 3.6 is not supported. If 3.7 is not supported either, can we have a similar message? Getting an exception is very confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants