-
-
Notifications
You must be signed in to change notification settings - Fork 428
Description
Perhaps I am missing something, but when I use a .python-version file to activate virtual environments, the $VIRTUAL_ENV variable isn't set. Using pyenv activate, however, does set it. For example, suppose I have a folder /projects/my_project with a .python-version file containing my_venv. When I cd into that folder, I can see that pyenv has properly detected the file and switched to using my_venv by running pyenv versions:
me@my_system$ pyenv versions
system
3.8.2
* my_venv (set by /projects/my_project/.python-version)My shell's prompt (which checks for ${VIRTUAL_ENV}) has not updated, and sure enough, running echo ${VIRTUAL_ENV} produces a blank line. If I run pyenv activate my_venv, though, it all works as expected: pyenv picks it up and echo ${VIRTUAL_ENV} returns /Users/me/.pyenv/versions/3.8.2/env/my_venv
Given the verbiage in the README ("pyenv-virtualenv will automatically activate/deactivate virtualenvs on entering/leaving directories which contain a .python-version file that contains the name of a valid virtual environment") I expected VIRTUAL_ENV to be set as it is via pyenv activate