0

Assume I installed Anaconda/Miniconda (with conda 4.5.*) but didn't add it to PATH. Then I created environment in non-standard location (not in ./envs/). Now everything I know is the path to python exec in this environment. How can I activate it? Should I find out where original root Miniconda is installed? How? Is there any way I can figure out that it's a conda created environment (so that it differs from other python)?

And I need methods that solve this problem both on Windows and on Linux. Actually I need to generate wrapper that activates conda env/virtual env (or don't activate if it's not an env) from setup.py post-install script that is pip installed from source (not wheel). I already know that if on Windows when pip is run it prepends <pyhon_env>\Library\bin to PATH (maybe if it's not already there), but it's not enough (or I don't know how to use it).

1 Answer 1

0

When run Conda sets CONDA_ROOT environment variable that contains absolute path to the root of the Anaconda/Miniconda installation (even if you didn't add it to PATH).

So you can get access to CONDA_ROOT when setup.py is run (during creation of env from yaml that has pip deps) and store it somewhere. I still don't know how to find conda root when installation is finished and you activate env and pip install...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.