1
0
Fork 0
mirror of https://github.com/python-poetry/install.python-poetry.org.git synced 2024-11-21 13:41:04 -05:00

installer: use virtualenv.pyz when ensurepip absent

This commit is contained in:
Arun Babu Neelicattu 2022-07-14 01:47:12 +02:00 committed by Bjorn Neergaard
parent 303392379b
commit be23be56c5

View file

@ -294,6 +294,11 @@ class VirtualEnvironment:
@classmethod
def make(cls, target: Path) -> "VirtualEnvironment":
try:
# on some linux distributions (eg: debian), the distribution provided python
# installation might not include ensurepip, causing the venv module to
# fail when attempting to create a virtual environment
# we import ensurepip but do not use it explicitly here
import ensurepip # noqa: F401
import venv
builder = venv.EnvBuilder(clear=True, with_pip=True, symlinks=False)