diff --git a/lib/spack/spack/environment/environment.py b/lib/spack/spack/environment/environment.py index 01516004979..01a956d6220 100644 --- a/lib/spack/spack/environment/environment.py +++ b/lib/spack/spack/environment/environment.py @@ -67,7 +67,8 @@ # ensure that this base directory exists since we require the root directory to be created # in our checks -os.makedirs(default_env_path, exist_ok = True) +if not os.path.isdir(default_env_path): + os.mkdir(default_env_path) #: Name of the input yaml file for an environment