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

Errors when starting to debug #143

Closed
roblourens opened this issue Nov 28, 2023 · 12 comments
Closed

Errors when starting to debug #143

roblourens opened this issue Nov 28, 2023 · 12 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@roblourens
Copy link
Member

Testing #141

Debugging started fine, but I got this error in the terminal. It was repeated multiple times

roblou@robfast:/datadrive/testext2$  /usr/bin/env /usr/bin/python3.9 /home/roblou/.vscode-insiders/extensions/ms-python.debugpy-2023.3.13271006-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 40923 -- /datadrive/testext2/test.py
E+00000.070: Error while enumerating installed packages.

             Traceback (most recent call last):
               File "/home/roblou/.vscode-insiders/extensions/ms-python.debugpy-2023.3.13271006-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/common/log.py", line 361, in get_environment_description
                 report("    {0}=={1}\n", pkg.name, pkg.version)
             AttributeError: 'PathDistribution' object has no attribute 'name'

             Stack where logged:
               File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
                 return _run_code(code, main_globals, None,
               File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
                 exec(code, run_globals)
               File "/home/roblou/.vscode-insiders/extensions/ms-python.debugpy-2023.3.13271006-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/__main__.py", line 91, in <module>
                 main()
               File "/home/roblou/.vscode-insiders/extensions/ms-python.debugpy-2023.3.13271006-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/__main__.py", line 21, in main
                 log.describe_environment("debugpy.launcher startup environment:")
               File "/home/roblou/.vscode-insiders/extensions/ms-python.debugpy-2023.3.13271006-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/common/log.py", line 369, in describe_environment
                 info("{0}", get_environment_description(header))
               File "/home/roblou/.vscode-insiders/extensions/ms-python.debugpy-2023.3.13271006-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/common/log.py", line 363, in get_environment_description
                 swallow_exception("Error while enumerating installed packages.")
               File "/home/roblou/.vscode-insiders/extensions/ms-python.debugpy-2023.3.13271006-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/common/log.py", line 215, in swallow_exception
                 _exception(format_string, *args, **kwargs)
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Nov 28, 2023
@paulacamargo25 paulacamargo25 added bug Issue identified by VS Code Team member as probable bug and removed triage-needed Needs assignment to the proper sub-team labels Nov 29, 2023
@simonbrady
Copy link

I get this with v2024.0.0-linux-x64 on VSC 1.86.0. Looks like it's fixed in debugpy 1.8.0?

@Deretaz
Copy link

Deretaz commented Feb 5, 2024

I get this same error with VSCode-x64-1.86.0 (Windows)

Just updated Python Debugger Extension to v2024.0.0

PS D:\Privat\Development\StreamDeck\Scripts>  & 'c:\Program Files\Python38\python.exe' 'c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher' '52492' '--' 'D:\Privat\Development\StreamDeck\Scripts\getCurrentDate.py' 
E+00000.047: Error while enumerating installed packages.

             Traceback (most recent call last):
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy\common\log.py", line 361, in get_environment_description
                 report("    {0}=={1}\n", pkg.name, pkg.version)
             AttributeError: 'PathDistribution' object has no attribute 'name'

             Stack where logged:
               File "C:\Program Files\Python38\lib\runpy.py", line 194, in _run_module_as_main
                 return _run_code(code, main_globals, None,
               File "C:\Program Files\Python38\lib\runpy.py", line 87, in _run_code
                 exec(code, run_globals)
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher\__main__.py", line 91, in <module>
                 main()
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher\__main__.py", line 21, in main
                 log.describe_environment("debugpy.launcher startup environment:")
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy\common\log.py", line 369, in describe_environment
                 info("{0}", get_environment_description(header))
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy\common\log.py", line 363, in get_environment_description
                 swallow_exception("Error while enumerating installed packages.")
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy\common\log.py", line 215, in swallow_exception
                 _exception(format_string, *args, **kwargs)


E+00000.015: Error while enumerating installed packages.

             Traceback (most recent call last):
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\common\log.py", line 361, in get_environment_description
                 report("    {0}=={1}\n", pkg.name, pkg.version)
             AttributeError: 'PathDistribution' object has no attribute 'name'

             Stack where logged:
               File "c:\Program Files\Python38\lib\runpy.py", line 194, in _run_module_as_main
                 return _run_code(code, main_globals, None,
               File "c:\Program Files\Python38\lib\runpy.py", line 87, in _run_code
                 exec(code, run_globals)
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy\__main__.py", line 39, in <module>
                 cli.main()
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 415, in main
                 api.ensure_logging()
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\api.py", line 61, in ensure_logging
                 log.describe_environment("Initial environment:")
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\common\log.py", line 369, in describe_environment
                 info("{0}", get_environment_description(header))
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\common\log.py", line 363, in get_environment_description
                 swallow_exception("Error while enumerating installed packages.")
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\common\log.py", line 215, in swallow_exception
                 _exception(format_string, *args, **kwargs)


E+00000.156: Error while enumerating installed packages.

             Traceback (most recent call last):
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\common\log.py", line 361, in get_environment_description
                 report("    {0}=={1}\n", pkg.name, pkg.version)
             AttributeError: 'PathDistribution' object has no attribute 'name'

             Stack where logged:
               File "c:\Program Files\Python38\lib\runpy.py", line 194, in _run_module_as_main
                 return _run_code(code, main_globals, None,
               File "c:\Program Files\Python38\lib\runpy.py", line 87, in _run_code
                 exec(code, run_globals)
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy\__main__.py", line 39, in <module>
                 cli.main()
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 430, in main
                 run()
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 281, in run_file
                 log.describe_environment("Pre-launch environment:")
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\common\log.py", line 369, in describe_environment
                 info("{0}", get_environment_description(header))
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\common\log.py", line 363, in get_environment_description
                 swallow_exception("Error while enumerating installed packages.")
               File "c:\Users\Benja\.vscode\extensions\ms-python.debugpy-2024.0.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\common\log.py", line 215, in swallow_exception
                 _exception(format_string, *args, **kwargs)

@leonf-tech
Copy link

leonf-tech commented Feb 6, 2024

I have tried upgrade to debug v2024.0.0.0 version. It doesn't work for me . And I also tried pre-release version, fail either. python debug extension version: ms-python.debugpy-2024.1.10362349-darwin-arm64
os: mac m1 12.4
python version: 3.8

@paulacamargo25
Copy link
Contributor

Thanks for your issue report, as you can see, the error was on debugpy side. The error was fixed in the version 1.8.0. Currently our last version of the Python Debugger uses debugpy 1.7.0, in the next release we will update the version of debugpy.

@paulacamargo25 paulacamargo25 added this to the February 2024 milestone Feb 6, 2024
@dorratz
Copy link

dorratz commented Feb 17, 2024

I have this issue too with the python debugger in Visual Studio Code - how can I solve it?

This is my environment:

OS name:Ubuntu 20.04.6 LTS
OS type: 64-bit

Visual studio code version:
Version: 1.86.2
Commit: 903b1e9d8990623e3d7da1df3d33db3e42d80eda
Date: 2024-02-13T19:41:37.860Z
Electron: 27.2.3
ElectronBuildId: 26908389
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Linux x64 5.15.0-94-generic

Python debugger version:v2024.0.0

This is the error I have in visual studio code:

cd /home/Documents/scripts2 ; /usr/bin/env /bin/python3 /home/ /.vscode/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 58729 -- /home/ /Documents/scripts2/print\ ("script").py
E+00000.030: Error while enumerating installed packages.

         Traceback (most recent call last):
           File "/home/.vscode/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/common/log.py", line 361, in get_environment_description
             report("    {0}=={1}\n", pkg.name, pkg.version)
         AttributeError: 'PathDistribution' object has no attribute 'name'
         
         Stack where logged:
           File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
             return _run_code(code, main_globals, None,
           File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
             exec(code, run_globals)
           File "/home/ /.vscode/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/__main__.py", line 91, in <module>
             main()
           File "/home/ /.vscode/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/__main__.py", line 21, in main
             log.describe_environment("debugpy.launcher startup environment:")
           File "/home/ /.vscode/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/common/log.py", line 369, in describe_environment
             info("{0}", get_environment_description(header))
           File "/home/ /.vscode/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/common/log.py", line 363, in get_environment_description
             swallow_exception("Error while enumerating installed packages.")
           File "/home/ /.vscode/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/common/log.py", line 215, in swallow_exception
             _exception(format_string, *args, **kwargs)

@Deretaz
Copy link

Deretaz commented Feb 18, 2024

Thanks for your issue report, as you can see, the error was on debugpy side. The error was fixed in the version 1.8.0. Currently our last version of the Python Debugger uses debugpy 1.7.0, in the next release we will update the version of debugpy.

As seen in the post above you, it will be fixed in the next version of debugpy. So update it via pip if available

@dorratz
Copy link

dorratz commented Feb 19, 2024

Thanks a lot, any expected date for the update?

@paulacamargo25
Copy link
Contributor

paulacamargo25 commented Feb 20, 2024

Thanks for the bug report, the latest pre-release version of the Python Debugger Extension now uses debugpy 1.8.1. Could you try again with the version 2024.3.*? Thank you

@anthonykim1
Copy link

Just tried step item 1 and 2 from original TPI #141 I think it is working

@DonJayamanne DonJayamanne added the verified Verification succeeded label Feb 22, 2024
@EeyoreLee
Copy link

@paulacamargo25 - hi, same situation but the latest prerelease version on my side is v2024.1.10371006.

@paulacamargo25
Copy link
Contributor

paulacamargo25 commented Feb 26, 2024

@EeyoreLee could you try updating vscode?

@EeyoreLee
Copy link

@paulacamargo25 - Thanks, new version can be found after updating vscode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

10 participants