2012-05-05 13:15:44 -04:00
|
|
|
Python
|
|
|
|
======
|
|
|
|
|
2012-09-02 21:14:32 -04:00
|
|
|
Enables local Python and local Python package installation.
|
|
|
|
|
|
|
|
Local Python Installation
|
|
|
|
-------------------------
|
|
|
|
|
2012-09-03 10:53:19 -04:00
|
|
|
[pythonz][4] builds and installs multiple Python versions locally in the home
|
2012-09-02 21:14:32 -04:00
|
|
|
directory.
|
|
|
|
|
|
|
|
This module prepends the pythonz directory to the path variable to enable the
|
|
|
|
execution of `pythonz`.
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
|
|
|
Install Python versions with `pythonz install` into *~/.pythonz/pythons*.
|
2012-05-05 13:15:44 -04:00
|
|
|
|
|
|
|
Local Package Installation
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
Since version 2.6, Python supports per user package installation, as defined in
|
|
|
|
[PEP 370][1].
|
|
|
|
|
2012-06-02 17:17:12 -04:00
|
|
|
This module prepends per user site directories to the relevant path variables
|
|
|
|
to enable the execution of user installed scripts and the reading of
|
|
|
|
documentation.
|
2012-05-05 13:15:44 -04:00
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
|
|
|
Install packages into the per user site directory with `easy_install --user` or
|
|
|
|
`pip install --user`.
|
|
|
|
|
|
|
|
virtualenvwrapper
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
[virtualenvwrapper][2] is a frontend to the popular [virtualenv][3] utility.
|
|
|
|
|
|
|
|
virtualenv creates isolated Python environments and virtualenvwrapper provides
|
|
|
|
convenient shell functions to create, switch, and manage them.
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
2012-09-03 10:53:19 -04:00
|
|
|
Install virtualenvwrapper.
|
|
|
|
|
|
|
|
Virtual environments are stored in *~/.virtualenvs*.
|
2012-05-05 13:15:44 -04:00
|
|
|
|
2012-09-03 11:27:58 -04:00
|
|
|
There are configuration variables that have to be set to enable certain features.
|
|
|
|
If you wish to use these features, export the variables in *~/.zshenv*
|
|
|
|
|
|
|
|
The variable `$PROJECT_HOME` tells virtualenvwrapper where to place project
|
|
|
|
working directories. It must be set and the directory created before `mkproject`
|
|
|
|
is used. Replace *Developer* with your projects directory.
|
|
|
|
|
|
|
|
export PROJECT_HOME="$HOME/Developer"
|
|
|
|
|
|
|
|
The variable `$VIRTUALENVWRAPPER_VIRTUALENV_ARGS` tells virtualenvwrapper what
|
|
|
|
arguments to pass to `virtualenv`. For example, set the value to
|
|
|
|
*--no-site-packages* to ensure that all new environments are isolated from the
|
|
|
|
system site-packages directory.
|
|
|
|
|
|
|
|
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
|
|
|
|
|
2012-09-03 10:34:41 -04:00
|
|
|
### Theming
|
|
|
|
|
|
|
|
To display the name of the current virtual enviroment in a prompt, define the
|
|
|
|
following style in the `prompt_theme_setup` function.
|
|
|
|
|
|
|
|
# %v - virtualenv name.
|
2012-09-03 16:08:39 -04:00
|
|
|
zstyle ':prezto:module:python' virtualenv 'virtualenv:%v'
|
2012-09-03 10:34:41 -04:00
|
|
|
|
|
|
|
Then add `$python_info[virtualenv]` to `$PROMPT` or `$RPROMPT` and call
|
|
|
|
`python-info` in the `prompt_theme_preexec` hook function.
|
|
|
|
|
2012-08-15 08:00:08 -04:00
|
|
|
Aliases
|
|
|
|
-------
|
|
|
|
|
|
|
|
- `py` is short for `python`.
|
|
|
|
|
2012-09-02 21:14:32 -04:00
|
|
|
### Pythonz
|
|
|
|
|
|
|
|
- `pyz` is short for `pythonz`.
|
|
|
|
- `pyzc` removes stale source folders and archives.
|
|
|
|
- `pyzi` installs Python versions.
|
|
|
|
- `pyzl` lists installed Python versions.
|
|
|
|
- `pyzL` lists available Python versions.
|
|
|
|
- `pyzu` updates itself to the latest version.
|
|
|
|
- `pyzx` uninstalls Python versions.
|
|
|
|
|
2012-09-03 10:34:41 -04:00
|
|
|
Functions
|
|
|
|
---------
|
|
|
|
|
|
|
|
- `python-info` exposes information about the Python environment via the
|
|
|
|
`$python_info` associative array.
|
|
|
|
|
2012-05-05 13:15:44 -04:00
|
|
|
Authors
|
|
|
|
-------
|
|
|
|
|
2012-05-21 20:18:30 -04:00
|
|
|
*The authors of this module should be contacted via the [issue tracker][5].*
|
2012-05-05 13:15:44 -04:00
|
|
|
|
2012-05-21 20:18:30 -04:00
|
|
|
- [Sorin Ionescu](https://github.com/sorin-ionescu)
|
|
|
|
- [Sebastian Wiesner](https://github.com/lunaryorn)
|
2012-05-05 13:15:44 -04:00
|
|
|
|
|
|
|
[1]: http://www.python.org/dev/peps/pep-0370/
|
|
|
|
[2]: http://www.doughellmann.com/projects/virtualenvwrapper/
|
|
|
|
[3]: http://pypi.python.org/pypi/virtualenv
|
2012-09-03 10:53:19 -04:00
|
|
|
[4]: http://saghul.github.com/pythonz/
|
2012-09-03 16:08:39 -04:00
|
|
|
[5]: https://github.com/sorin-ionescu/prezto/issues
|
2012-05-05 13:15:44 -04:00
|
|
|
|