pradyunsg
(Pradyun Gedam)
March 31, 2025, 4:38pm
21
```
There are two entries for each virtualenv, and the shorter one is just a symlink.
### Activate virtualenv
Some external tools (e.g. [jedi](https://github.com/davidhalter/jedi)) might
require you to `activate` the virtualenv and `conda` environments.
If `eval "$(pyenv virtualenv-init -)"` is configured in your shell, `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 as shown in the output of `pyenv virtualenvs` (e.g., `venv34` or `3.4.3/envs/venv34` in example above) . `.python-version` files are used by pyenv to denote local Python versions and can be created and deleted with the [`pyenv local`](https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-local) command.
You can also activate and deactivate a pyenv virtualenv manually:
```sh
pyenv activate <name>
pyenv deactivate
```
### Delete existing virtualenv
There’s also other usage patterns of the .python-version
file. I’ve linked one above, wherein pyenv-virtualenv expects to see a virtual environment name in that file instead of a list of Python versions.