Skip to content

Deactivating Pyenv virtual enviornment #289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sbhakat opened this issue Nov 17, 2018 · 0 comments
Open

Deactivating Pyenv virtual enviornment #289

sbhakat opened this issue Nov 17, 2018 · 0 comments

Comments

@sbhakat
Copy link

sbhakat commented Nov 17, 2018

Quite similar to this issue #32 however I posted the question at the above mentioned link but got no reply.

I have the following problem while deactivating pyenv

#Checking the version

pyenv versions
  system
  3.6.7
  3.6.7/envs/keras-test
* keras-test (set by /home/sbhakat/.python-version)

Then I progressed like

env | grep PYENV
PYENV_ROOT=/home/sbhakat/.pyenv
PYENV_VIRTUALENV_INIT=1
PYENV_VIRTUAL_ENV=/home/sbhakat/.pyenv/versions/3.6.7/envs/keras-test
PYENV_SHELL=bash

Trying to deactivate like

pyenv sh-deactivate keras-test
unset PYENV_VIRTUAL_ENV;
unset VIRTUAL_ENV;
if [ -n "${_OLD_VIRTUAL_PATH}" ]; then
  export PATH="${_OLD_VIRTUAL_PATH}";
  unset _OLD_VIRTUAL_PATH;
fi;
if [ -n "${_OLD_VIRTUAL_PYTHONHOME}" ]; then
  export PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME}";
  unset _OLD_VIRTUAL_PYTHONHOME;
fi;
if [ -n "${_OLD_VIRTUAL_PS1}" ]; then
  export PS1="${_OLD_VIRTUAL_PS1}";
  unset _OLD_VIRTUAL_PS1;
fi;
if declare -f deactivate 1>/dev/null 2>&1; then
  unset -f deactivate;
fi;

I also hashed the following part in .bashrc however seems like it is not working any help?

#if command -v pyenv 1>/dev/null 2>&1; then
#   eval "$(pyenv init -)"
#fi

This seems like an annoying problem. any help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant