add pyenv to python module

This commit is contained in:
Marcos Trovilho 2013-02-16 14:48:44 -02:00
parent f4d9b32de9
commit b91bc8a1d2
2 changed files with 22 additions and 2 deletions

View file

@ -16,6 +16,16 @@ execution of `pythonz`.
Install Python versions with `pythonz install` into *~/.pythonz/pythons*.
pyenv
-----
An alternative pythonz is to use [pyenv][6], which allows for switching between
multiple, isolated Python installations in the home directory.
### Usage
Install Python versions with `pyenv install` into *~/.pyenv/versions*.
Local Package Installation
--------------------------
@ -107,4 +117,4 @@ Authors
[3]: http://pypi.python.org/pypi/virtualenv
[4]: http://saghul.github.com/pythonz/
[5]: https://github.com/sorin-ionescu/prezto/issues
[6]: https://github.com/yyuu/pyenv

View file

@ -9,10 +9,20 @@
# Load pythonz into the shell session.
if [[ -s $HOME/.pythonz/bin/pythonz ]]; then
path=($HOME/.pythonz/bin $path)
# Load manually installed pyenv into the shell session.
elif [[ -s "$HOME/.pyenv/bin/pyenv" ]]; then
path=("$HOME/.pyenv/bin" $path)
eval "$(pyenv init -)"
# Load package manager installed pyenv into the shell session.
elif (( $+commands[pyenv] )); then
eval "$(pyenv init -)"
fi
# Return if requirements are not found.
if (( ! $+commands[python] && ! $+commands[pythonz] )); then
if (( ! $+commands[python] && ! ( $+commands[pythonz] || $+commands[pyenv] ) )); then
return 1
fi