Can't run rust code in VS code

I haven't used rust for a while and now I can't run rust code in VS-code. I have updated rustup to the last version, set default to stable, reinstalled rust-analyzer ,but I stil can't tun code.
When I use the cargo run command, I get the next result:

    Blocking waiting for file lock on package cache

I also get notification:
Setting up workspace: Loading packages..

That message means another Cargo command is already running. It may be just slow (e.g. fetching the index or compiling dependencies) or perhaps stuck somehow. If you kill it (e.g. killall cargo on unix) it should solve the issue.

If it's not running, and the filesystem lock somehow got permanently stuck, then deleting .cargo directory in your home should fix it.

And how to disactivate cargo processes on Windows?

You could find them in the task manager. Another option is to reboot, which will kill them.

taskkill /im cargo.exe

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.