mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 23:00:18 +00:00
Add information on pyenv
This commit is contained in:
+26
-1
@@ -232,7 +232,32 @@ For example, you can work on a project which requires Django 1.3 while also
|
|||||||
maintaining a project which requires Django 1.0.
|
maintaining a project which requires Django 1.0.
|
||||||
|
|
||||||
To start using and see more information:
|
To start using and see more information:
|
||||||
`Virtual Environments <http://github.com/kennethreitz/python-guide/blob/master/docs/dev/virtualenvs.rst>`_ docs.
|
`Virtual Environments <http://github.com/kennethreitz/python-guide/blob/master/docs/dev/virtualenvs.rst>`_ docs.
|
||||||
|
|
||||||
|
|
||||||
|
pyenv
|
||||||
|
-----
|
||||||
|
|
||||||
|
`pyenv <https://github.com/yyuu/pyenv>`_ is a tool to allow multiple versions
|
||||||
|
of the Python interpreter to be installed at the same time. This solves the
|
||||||
|
problem of having different projects requiring different versions of Python.
|
||||||
|
For example, it becomes very easy to install Python 2.7 for compatibility in
|
||||||
|
an one project, whilst still using Python 3.4 as the default interpreter.
|
||||||
|
pyenv isn't just limited to the CPython versions - it will also install PyPy,
|
||||||
|
anaconda, miniconda, stackless, jython, and ironpython interpreters.
|
||||||
|
|
||||||
|
pyenv works by filling a ``shims`` directory with fake versions of the Python
|
||||||
|
interpreter (plus other tools like ``pip`` and ``2to3``). When the system
|
||||||
|
looks for a program named ``python``, it looks inside the ``shims`` directory
|
||||||
|
first, and uses the fake version, which in turn passes the command on to
|
||||||
|
pyenv. pyenv then works out which version of Python should be run based on
|
||||||
|
environment variables, ``.python-version`` files, and the global default.
|
||||||
|
|
||||||
|
pyenv isn't a tool for managing virtual environments, but there is a plugin
|
||||||
|
`pyenv-virtualenv <https://github.com/yyuu/pyenv-virtualenv>`_ which automates
|
||||||
|
the creation of different environments, and also makes it possible to use the
|
||||||
|
existing pyenv tools to switch to different environments based on environment
|
||||||
|
variables or ``.python-version`` files.
|
||||||
|
|
||||||
Other Tools
|
Other Tools
|
||||||
:::::::::::
|
:::::::::::
|
||||||
|
|||||||
Reference in New Issue
Block a user