From 46c28c0d104535f685931659e864efcd7be7e09b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 30 Sep 2023 20:28:31 -0700 Subject: [PATCH] pkgs/sage-conf_conda/setup.py: Exit early when no conda env is active --- pkgs/sage-conf_conda/setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/sage-conf_conda/setup.py b/pkgs/sage-conf_conda/setup.py index a2333f6b8d5..21977a81ca4 100644 --- a/pkgs/sage-conf_conda/setup.py +++ b/pkgs/sage-conf_conda/setup.py @@ -24,6 +24,10 @@ def run(self): else: SAGE_ROOT = self._create_writable_sage_root() + if not os.environ.get('CONDA_PREFIX', ''): + raise SetupError('No conda environment is active. ' + 'See https://doc.sagemath.org/html/en/installation/conda.html on how to get started.') + if os.path.exists(os.path.join(SAGE_ROOT, 'config.status')): print(f'Reusing configured SAGE_ROOT={SAGE_ROOT}') else: