Skip to content

docker-nox does not install ensurepip module?ย #1004

@paduszyk

Description

@paduszyk

First of all, thanks for this Docker image. It is really helpful! ๐Ÿ‘๐Ÿป

I have tried creating a virtual environment using venv (I'm on a dev container in VS Code).

This is what I get:

$ python3.12 -m venv myenv
Error: Command '['/workspaces/project/myenv/bin/python3.12', '-m', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

myenv is created but pip is not installed. It looks like because ensurepip module is not found:

$ myenv/bin/python -m ensurepip
/workspaces/project/myenv/bin/python3.12: No module named ensurepip

A workaround is:

#!/usr/bin/env bash

set -e

curl -fsSo /tmp/get_pip.py https://bootstrap.pypa.io/get-pip.py

python3.12 -m venv --without-pip .venv

.venv/bin/python /tmp/get_pip.py
.venv/bin/python -m pip install -e '.[dev]'

rm /tmp/get_pip.py

but I feel that having pip by default is quite unnatural. Is there any reason for that? Or maybe I am doing something wrong. Let me know, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions