question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python extension throwing various errors after VS Code update to 1.56.1

See original GitHub issue

Environment data

  • VS Code version: 1.56.1
  • Extension version (available under the Extensions sidebar): v2021.5.829140558
  • OS and version: Windows 10 Pro ; Version 10.0.19042 Build 19042
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 3.7.6 64-bit (but the same error can be replicated with any installed distribution)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
  • Relevant/affected Python packages and their versions: N/A
  • Relevant/affected Python-related VS Code extensions and their versions: N/A
  • Value of the python.languageServer setting: Microsoft (or any other)

[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

Expected behaviour

When starting a new debug session the first breakpoint in previously working program should be hit without any warnings or errors.

Actual behaviour

The breakpoint is hit, but there are errors in the debug output even before the script ‘initializes’. Reloading the window, changing Python environment or reinstalling Python, Jupyter and other affected extensions solves nothing.

Steps to reproduce:

  1. Update VS Code in Win 10 to 1.56.1.
  2. Set a breakpoint in a Python script.
  3. Start debugging session - breakpoint is hit but a bunch of errors get written to the output before the main Python file even launches.

Temporary solution

The only way to get rid of these errors is to revert to previous version of the Python extension (v2021.4.765268190).

Logs

Output log, pop-up error message, debug output

Output log

User belongs to experiment group 'pythonaa'
User belongs to experiment group 'pythonJediLSP'
User belongs to experiment group 'pythonDiscoveryModuleWithoutWatcher'
User belongs to experiment group 'pythonTensorboardExperiment'
User belongs to experiment group 'PythonPyTorchProfiler'
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - control'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'RunByLine - experiment'
Python interpreter path: C:\ProgramData\Anaconda3\python.exe
Starting Microsoft Python language server.
Python interpreter path: C:\Program Files (x86)\Python37-32\python.exe
Starting Microsoft Python language server.
Python interpreter path: C:\ProgramData\Anaconda3\python.exe

Pop-up message

Cannot activate the 'Python' extension because it depends on the 'Jupyter' extension, which is not loaded. Would you like to reload the window to load the extension?

Downloading https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-win-x64.0.5.59.nupkg...
Language server download failed
Error: connect ETIMEDOUT 13.107.213.60:443

pydev debugger: critical: unable to get real case for file. Details:
filename: src
drive: 
parts: ['src']
(please create a ticket in the tracker to address this).

Debugger output

pydev debugger: critical: unable to get real case for file. Details:
filename: src
drive: 
parts: ['src']
(please create a ticket in the tracker to address this).
Traceback (most recent call last):
  File "c:\...\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 221, in _get_path_with_real_case
    return _resolve_listing(drive, iter(parts))
  File "c:\...\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 184, in _resolve_listing        
    dir_contents = cache[resolved_lower] = os.listdir(resolved)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\...\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 226, in _get_path_with_real_case
    return _resolve_listing(drive, iter(parts))
  File "c:\...\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 184, in _resolve_listing
    dir_contents = cache[resolved_lower] = os.listdir(resolved)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''
pydev debugger: critical: unable to get real case for file. Details:
filename: src
drive:
parts: ['src']
(please create a ticket in the tracker to address this).
Traceback (most recent call last):
  File "c:\...\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 221, in _get_path_with_real_case
    return _resolve_listing(drive, iter(parts))
  File "c:\...\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 184, in _resolve_listing
    dir_contents = cache[resolved_lower] = os.listdir(resolved)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\...\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 226, in _get_path_with_real_case
    return _resolve_listing(drive, iter(parts))
  File "c:\...\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 184, in _resolve_listing
    dir_contents = cache[resolved_lower] = os.listdir(resolved)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
joyceerhlcommented, May 12, 2021

Closing as a dupe of #16209, please let us know if upgrading to v2021.6.832593372 doesn’t work for you. Thanks and sorry for the trouble!

0reactions
RobertBarachinicommented, May 17, 2021

Solved with the new Python extension update - thanks for the help @joyceerhl! The new language server works great as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found