PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, August 20, 2022

[FIXED] How to get base conda installation directory (not CONDA_PREFIX)?

 August 20, 2022     bash, conda, environment, environment-variables, python     No comments   

Issue

I'm trying to figure out the best way to get the base conda installation directory.

I wrote this but I know this isn't the best way to do it:

(base) -bash-4.2$ which conda
/usr/local/devel/ANNOTATION/jespinoz/anaconda3/bin/conda

(base) -bash-4.2$ which conda | python -c "import sys; print('/'.join(sys.stdin.read().split('/')[:-2]))"
/usr/local/devel/ANNOTATION/jespinoz/anaconda3

Is there some environment variable I'm missing?


Solution

One trick is to echo CONDA_PREFIX from activated base:

conda run -n base bash -c "echo \${CONDA_PREFIX}"

There is also CONDA_ROOT, but I don't think that is defined when no environment is activated.



Answered By - merv
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing