Bingo, the finding in the update #1 was the cause. The space in my username was the culprit. Although I have no idea what triggered this behavior change on my account… (anybody with an answer, please follow up.)
Let’s say the per-user python is installed at
C:\Users\User Name\AppData\Local\Programs\Python\Python310
In my case, “Microsoft Visual C++ 2015-2022 Redistributable” installer (VC_redist.x64.exe) left a log file C:\Users\User
(a text file with the first part of my account name as its file name). This caused python venv to use C:\Users\User
as the python executable and promptly failed (see the issue tracker link below for the full explanation).
You can fix the issue in 2 ways until Python patches the problem.
Easy Fix
Simply delete the file C:\Users\User
Note: This will work until next time another installer leaves this nasty log file.
More Involved Fix
In command console, run
DIR /X C:\Users
which lists something like:
02/08/2022 11:44 AM <DIR> .
02/08/2022 11:44 AM <DIR> ..
11/19/2020 01:48 AM <DIR> Public
02/08/2022 02:47 PM <DIR> USERNA~1 User Name
Open the Environmental Variables dialog and edit Path user variable’s Python entries from
C:\Users\User Name\AppData\Local\Programs\Python\Python310\Scripts
C:\Users\User Name\AppData\Local\Programs\Python\Python310
to
C:\Users\USERNA~1\AppData\Local\Programs\Python\Python310\Scripts
C:\Users\USERNA~1\AppData\Local\Programs\Python\Python310
Re-open python console window or app so the path change is applied to your dev environment.
Note: This fix will work as long as you don’t update python version. When you do, you need to delete the old path entries manually and update the new path entries.
Eventual Fix
I reported this bug to python bug tracker: Issue 46686. They’ve acknowledged the bug and have it labeled as critical
with a proposed fix. So, hopefully it will get fixed in a near future release. (>3.10.2)