Cannot remove venv folder with viktor-cli install

Since a month or so we often get this message in VSCode. No instances are running, but we first have to close down VSCode or delete the venv folder manually via the windows explorer. Do you have any idea how to fix this?

PS C:\DevOps\Python.ParametricDesign\WegenTool> viktor-cli.exe install
SDK version: 13.6.1 Connector version: 5.18.1
Creating app specific install dir signals
Exiting because of an error: cannot complete installation of app. During the removal of the existing 'venv' folder the following error occured:
Operation 'remove' on 'C:\DevOps\Python.ParametricDesign\WegenTool\venv\Scripts\python.exe' failed because 'Access is denied.'
Please make sure that the file is not in use by another process or remove the virtual environment folder 'venv' manually

Hi Sjoerd,

Strange that this started happening a month ago, I take it before that you did not see this problem occur? As a first check question: do you also get this error if you open VSCode as admin?

Hi Roeland,

I did some testing now.
When I start VSCode as administrator I do not have the problem.
I notice now that when I use viktor-cli install after I have been running the code in debug mode in VSCode the venv fails. When I looked into the folder I see that all files have been remove except venv/Scripts/python.exe.
So it is probably that VSCode locks the python.exe even when the process is not running anymore.
This problem does not occur when the viktor-cli start command is used instead of debug mode.

So I guess it is a visual studio code thing than and not something you can fix.