Skip to content

Commit 46c28c0

Browse files
author
Matthias Koeppe
committed
pkgs/sage-conf_conda/setup.py: Exit early when no conda env is active
1 parent 2c54bdc commit 46c28c0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkgs/sage-conf_conda/setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ def run(self):
2424
else:
2525
SAGE_ROOT = self._create_writable_sage_root()
2626

27+
if not os.environ.get('CONDA_PREFIX', ''):
28+
raise SetupError('No conda environment is active. '
29+
'See https://doc.sagemath.org/html/en/installation/conda.html on how to get started.')
30+
2731
if os.path.exists(os.path.join(SAGE_ROOT, 'config.status')):
2832
print(f'Reusing configured SAGE_ROOT={SAGE_ROOT}')
2933
else:

0 commit comments

Comments
 (0)