6

I got an error when creating virtualenv with Python 3.11 interpreter.

I typed this in my terminal

python3.11 -m venv env

It returned this:

Error: Command '['/home/bambang/env/bin/python3.11', '-m', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

What's possibly missing?

2 Answers2

5

I tried to add --without-pip flag. It doesn't return an error so far

  • 1
    To complete the story, one usually do want 'pip'. So, look at the next step for example here: https://stackoverflow.com/a/69527217/1614089 – Oren Feb 14 '23 at 10:11
  • I have fixed it, brother. I manually download `pip` afterwards, and install it. I have written full article to solve this my way, https://medium.com/@bambang.wirojoyo/setting-up-python-3-11-environment-with-pip-33125a1cf34d – Bambang Wirojoyo Sentiko Feb 23 '23 at 06:46
  • pip will be missing when you want to install dependencies later, so this is kind of a very temporary workaround. – matanster Apr 19 '23 at 17:01
3
sudo apt install python3.11-venv
S.B
  • 13,077
  • 10
  • 22
  • 49