1
0
Fork 0
mirror of https://github.com/python-poetry/install.python-poetry.org.git synced 2024-11-06 06:05:52 -05:00

fix: check that sys.executable is valid before env creation

This commit is contained in:
Bjorn Neergaard 2022-09-16 12:15:24 -06:00
parent 206447fcd4
commit e8d8f76750

View file

@ -293,6 +293,11 @@ class VirtualEnvironment:
@classmethod @classmethod
def make(cls, target: Path) -> "VirtualEnvironment": def make(cls, target: Path) -> "VirtualEnvironment":
if not sys.executable:
raise ValueError(
"Unable to determine sys.executable. Set PATH to a sane value or set it explicitly with PYTHONEXECUTABLE."
)
try: try:
# on some linux distributions (eg: debian), the distribution provided python # on some linux distributions (eg: debian), the distribution provided python
# installation might not include ensurepip, causing the venv module to # installation might not include ensurepip, causing the venv module to