I'm using both conda and pyenv and would like to switch between both while staying in the same terminal.
The entries to initialize both in my .bashrc look as follows:
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/myUser/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/myUser/miniconda3/etc/profile.d/conda.sh" ]; then
. "/home/myUser/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/home/myUser/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
and
# Pyenv initialize
export PATH="/home/myUser/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
I simply tried to put the initialization lines (for pyenv) in a separate shell script, however it does not work (pyenv doesn't get initialized).
Info: Pyenv is yet another virtual python environment which I need for usage in combination with poetry