INNER CODE UNIT · Python
remove_by_del
devstream-io/devstream · devstream/env_manager.py:259
def remove_by_del(self, env_name: str) -> bool:
"""
Remove the python environment.
"""
env_path = os.path.join(MAMBA_PY_ENVS, env_name)
try:
# Remove the environment directory
if os.path.exists(env_path):
shutil.rmtree(env_path)
return True
except Exception as e:
logger.warning(f"Failed to remove environment {env_name}: {e}")
return False
def remove_by_mamba(self, env_name: str) -> bool:
"""
Remove the python environment.
"""