Skip to content

Commit be23be5

Browse files
abnneersighted
authored andcommitted
installer: use virtualenv.pyz when ensurepip absent
1 parent 3033923 commit be23be5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

install-poetry.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ def bin_path(self):
294294
@classmethod
295295
def make(cls, target: Path) -> "VirtualEnvironment":
296296
try:
297+
# on some linux distributions (eg: debian), the distribution provided python
298+
# installation might not include ensurepip, causing the venv module to
299+
# fail when attempting to create a virtual environment
300+
# we import ensurepip but do not use it explicitly here
301+
import ensurepip # noqa: F401
297302
import venv
298303

299304
builder = venv.EnvBuilder(clear=True, with_pip=True, symlinks=False)

0 commit comments

Comments
 (0)