1

When I try to generate a virtual environment, the following error pops up on Windows 11:

PS C:\programming\tmp> python -m venv venv
Error: Command '['C:\\programming\\tmp\\venv\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 101.

I have uninstalled all versions of python I did reinstall python 3.10.1 but the error remains. Based on this post I did try to install it for all users with no success. I also added python to PATH.

My guess is that it is related to pip, since python -m venv --without-pip venv_no_pip works (but I need pip thus this is no good solution).

I would appreciate any hint on what to do since I'm out of ideas.

2

1 Answer 1

0

I encountered the same problem (well, all users install did work on my PC) and found a solution. If your python is installed on a path with a space, check out my self-answer

Sign up to request clarification or add additional context in comments.

2 Comments

This was indeed also the problem on my computer. Surprisingly, it was no problem in the past.
@user7431005 - right? Some account-specific change in Windows triggers this behavior. I filed a bug report to python, and they acknowledged it. So hopefully it'll get fixed soon

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.