"Install Python" task fails with "because it is being used by another process" error on nuget install python command. When running the same command shown in the log output directly in a command window as the same user id the command succeeds. Workaround is to add a "nuget custom" step (with args install -OutputDirectory "$(Agent.ToolsDirectory)\PythonNuget" python) before the "Install Python" step that runs the same install command line and installs python to the same target location. Error messages shown below.
"Install Python" task fails with "because it is being used by another process" error on nuget install python command. When running the same command shown in the log output directly in a command window as the same user id the command succeeds. Workaround is to add a "nuget custom" step (with args install -OutputDirectory "$(Agent.ToolsDirectory)\PythonNuget" python) before the "Install Python" step that runs the same install command line and installs python to the same target location. Error messages shown below.
Retrieving package 'python 3.10.4' from 'nuget.org'. GET https://api.nuget.org/v3-flatcontainer/python/3.10.4/python.3.10.4.nupkg OK https://api.nuget.org/v3-flatcontainer/python/3.10.4/python.3.10.4.nupkg 12ms WARNING: Error downloading 'python.3.10.4' from 'https://api.nuget.org/v3-flatcontainer/python/3.10.4/python.3.10.4.nupkg'. The process cannot access the file 'C:\Users{some_user_id}.nuget\packages\python\3.10.4\tools\python310.dll' because it is being used by another process. GET https://api.nuget.org/v3-flatcontainer/python/3.10.4/python.3.10.4.nupkg OK https://api.nuget.org/v3-flatcontainer/python/3.10.4/python.3.10.4.nupkg 11ms WARNING: Error downloading 'python.3.10.4' from 'https://api.nuget.org/v3-flatcontainer/python/3.10.4/python.3.10.4.nupkg'. The process cannot access the file 'C:\Users{some_user_id}.nuget\packages\python\3.10.4\tools\python310.dll' because it is being used by another process. GET https://api.nuget.org/v3-flatcontainer/python/3.10.4/python.3.10.4.nupkg OK https://api.nuget.org/v3-flatcontainer/python/3.10.4/python.3.10.4.nupkg 13ms WARNING: Install failed. Rolling back... Executing nuget actions took 5.24 sec Error downloading 'python.3.10.4' from 'https://api.nuget.org/v3-flatcontainer/python/3.10.4/python.3.10.4.nupkg'. The process cannot access the file 'C:\Users{some_user_id}.nuget\packages\python\3.10.4\tools\python.exe' because it is being used by another process.