Error when creating venv¶
When creating a virtual environment in Python, you might encounter the following error:
Bash
python -m venv venv
# Error message:
Error: Command '['/home/ubuntu/venv/bin/python', '-m', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
This error typically occurs when the ensurepip module fails to install pip in the virtual environment. Here are some steps to resolve this issue: