mirror of
https://github.com/clearml/clearml-agent
synced 2025-06-08 23:47:15 +00:00
Use "venv" module if virtualenv is not supported
This commit is contained in:
parent
6b31883e45
commit
77de343863
@ -64,9 +64,18 @@ class VirtualenvPip(SystemPip, PackageManager):
|
|||||||
Only valid if instantiated with path.
|
Only valid if instantiated with path.
|
||||||
Use self.python as self.bin does not exist.
|
Use self.python as self.bin does not exist.
|
||||||
"""
|
"""
|
||||||
|
# noinspection PyBroadException
|
||||||
|
try:
|
||||||
self.session.command(
|
self.session.command(
|
||||||
self.python, "-m", "virtualenv", self.path, *self.create_flags()
|
self.python, "-m", "virtualenv", self.path, *self.create_flags()
|
||||||
).check_call()
|
).check_call()
|
||||||
|
except Exception as ex:
|
||||||
|
# let's try with std library instead
|
||||||
|
print("WARNING: virtualenv call failed: {}\n INFO: Creating virtual environment with venv".format(ex))
|
||||||
|
self.session.command(
|
||||||
|
self.python, "-m", "venv", self.path, *self.create_flags()
|
||||||
|
).check_call()
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def remove(self):
|
def remove(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user