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.

Error in python extension when launching from terminal

See original GitHub issue

Issue Type: Bug

Behaviour

Expected vs. Actual

When I launch Vscode from my console (cmder/powershell) with the command code . (Inside a python project folder). I have an error in the Python output :

[ERROR 2022-1-17 15:21:11.939]: Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir 'D:\Dev\MyProject'
	at Object.readdirSync (fs.js:1021:3)
	at Object.e.readdirSync (electron/js2c/asar_bundle.js:5:10478)
	at c:\Users\me\.vscode\extensions\ms-python.python-2022.0.1814523869\out\client\extension.js:24:259625
	at c:\Users\me\.vscode\extensions\ms-python.python-2022.0.1814523869\out\client\extension.js:24:259776
	at Array.map (<anonymous>)
	at h.initWatchers (c:\Users\me\.vscode\extensions\ms-python.python-2022.0.1814523869\out\client\extension.js:24:259571)
	at async h.ensureWatchersReady (c:\Users\me\.vscode\extensions\ms-python.python-2022.0.1814523869\out\client\extension.js:52:4321)] {
  errno: -4058,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '\x1B[34mD:\\Dev\\MyProject'
}

It seems it add caracters to the folder path (console color caracters ???).

When this error occurs, VSCode use a lot of CPU and PyLance is very slow.

No problem if I open VSCode manualy and open my project.

I’m on Windows 10, VSCode and Python extensions up to date.

Extension version: 2022.0.1814523869 VS Code version: Code 1.64.2 (f80445acd5a3dadef24aa209168452a3d97cc326, 2022-02-09T22:02:28.252Z) OS version: Windows_NT x64 10.0.19042 Restricted Mode: No

System Info
Item Value
CPUs Intel® Core™ i5-4570 CPU @ 3.20GHz (4 x 3193)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.94GB (7.28GB free)
Process Argv . --crash-reporter-id 5d214d33-14b8-4151-9615-ac62aa910fb2
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30425749
pythontb:30283811
pythonvspyt551:30345470
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscorecescf:30438341
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30433507
vsclayoutctrc:30437038
vsrem710:30416614
dsvsc008:30436278
pythonvspyt640:30436486
vsbas813:30436447
vscscmwlcmt:30438805
helixcf:30438807
vscaac:30438847

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
lilithabaddoncommented, Feb 18, 2022

I switched to insiders daily channel and it seems to work fine with this poetry config. Thank you

0reactions
karrtikrcommented, Feb 18, 2022

Happy coding!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run Python file in Terminal with error "& was unexpected at ...
For me the issue resolved by redirecting the console path to the target file that I would try to execute. Both cmd and...
Read more >
Terminal error in VS Code when starting the Python ...
The terminal process failed to launch: Path to shell executable "bin/sh" does not exist. I can successfully debug using for example ipdb by ......
Read more >
Work in Windows Subsystem for Linux with Visual Studio Code
The WSL extension enables you to run Visual Studio Code within the Windows Subsystem for ... This will open a Linux terminal and...
Read more >
How To Run Python Code In Visual Studio Code's Terminal ...
... install python from official site 00:08 run installer and check py launcher 00:18 setup vscode python extension 00:26 save hello.py file ...
Read more >
VS Code Debugger not working for python
The Python extension is broken - just seems to have updated at the same time as VS Code. Go back to extension version...
Read more >

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