0

By conda enabled I mean that's one of the two blends of Python that are published but Continuum Analytics (Anaconda and Miniconda).

My original implementation was if 'conda' in sys.version but it seems that will not work as expected.

It seems that miniconda reports something like Python 3.5.2 :: Continuum Analytics, Inc.

Why I need to detect this?

That's because we want to change the build-script behaviour based on on this and use conda installer instead of pip for some tasks.

sorin
  • 161,544
  • 178
  • 535
  • 806
  • This question is now a duplicate of [*How to detect from within Python whether packages are managed with conda*](https://stackoverflow.com/questions/47608532/how-to-detect-from-within-python-whether-packages-are-managed-with-conda), whose comprehensive question *and* numerous high-quality answers supersede those provided here. Praise be to [the definitive answer](https://stackoverflow.com/a/47610844/2809027)! – Cecil Curry May 03 '18 at 04:50

1 Answers1

0

While I do not find the code beautiful that's my current implementation:

import sys
if 'conda' in sys.version or 'Continuum' in sys.version: print("conda!")
sorin
  • 161,544
  • 178
  • 535
  • 806