How can I find out which Python version is installed in a conda
environment where I know the name, but do not want to activate that environment?
Background: I have chosen the lazy way to get python3.6
on my Ubuntu 14.04
machine and installed conda
. But I would like to add certain directories to my PYTHONPATH
depending on whether the environment has python2.x
or python3.x
and I plan to do this by wrapping conda
's activate
like so:
PYMAJOR=$(a_miracle_occurs $CONDAENV)
BASHRC=$(cat <<EOF
source ~/.bashrc
source activate $CONDAENV
export PATH=...
export PYTHONPATH=".../modules$PYMAJOR"
"
EOF
)
bash --rcfile <(echo "${BASHRC}")
I have no compatibility issues with subversions of python
and I do not want to setup.py develop
the modules in the PYTHONPATH
-to-be because there are still too many changes, also on structural level.
Remark: I am aware of conda list -n ENVNAME
but this would involve parsing human readable output and I would feel better off to have something retrieving the info in machine readable form.