microsoft / vscode-python-debugger

Python debugger (debugpy) extension for VS Code.
https://marketplace.visualstudio.com/items?itemName=ms-python.debugpy
MIT License
41 stars 17 forks source link

Debugger won't launch (Could not import runpy module) #275

Closed vadi2 closed 3 weeks ago

vadi2 commented 3 months ago

Launching the Python debugger to start debugging is failing with:

$  /usr/bin/env /home/vadi/Programs/miniconda3/envs/disy/bin/python /home/vadi/.vscode/extensions/ms-python.debugpy-2024.2.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 49253 -- /home/vadi/Programs/DiSyFHIRtools/run_examples.py --direction disy_to_fhir 
Could not import runpy module
Traceback (most recent call last):
  File "/home/vadi/Programs/miniconda3/envs/disy/lib/python3.11/runpy.py", line 15, in <module>
    import importlib.util
  File "/home/vadi/Programs/miniconda3/envs/disy/lib/python3.11/importlib/util.py", line 1, in <module>
    current.entry.append({'resource': fhir_resource})
    ^^^^^^^
NameError: name 'current' is not defined

current is defined however, and running a script without debugging works just fine:

$  cd /home/vadi/Programs/DiSyFHIRtools ; /usr/bin/env /home/vadi/Programs/miniconda3/envs/disy/bin/python /home/vadi/.vscode/extensions/ms-python.debugpy-2024.2.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 60081 -- /home/vadi/Programs/DiSyFHIRtools/run_examples.py --direction disy_to_fhir 
# script output here

What could be the issue? I've went as far as deleting the line current.entry.append({'resource': fhir_resource}) entirely from my script and the error message is exactly the same.

I've also tried:

The cached error is still all entirely the same.

Version information: VS Code: 1.87.2 Extension: Python: 3.12 OS: Debian 12 (Chromebook)

paulacamargo25 commented 3 weeks ago

Thanks for your bug report, and sorry for the delay. This was a debugpy issue, could you try with the last version of the Python Debugger Extension and if the error persist you can reopen the issue. Thanks