Merge pull request #227 from blueyed/doc-multiple-versions

doc: note about using multiple versions
This commit is contained in:
Yamashita, Yuu 2014-09-03 10:17:30 +09:00
commit 2297bd3741

View file

@ -126,6 +126,9 @@ reading it from the following sources, in this order:
Python. (In other words, whatever version would run if pyenv weren't in your
`PATH`.)
**NOTE:** You can activate multiple versions at the same time, e.g. `pyenv
global 3.4.1 2.7.8`. This allows for parallel usage of python2 and python3,
and is required with tools like `tox`.
### Locating the Python Installation
@ -134,7 +137,7 @@ specified, it passes the command along to the corresponding Python
installation.
Each Python version is installed into its own directory under
`~/.pyenv/versions`.
`~/.pyenv/versions`.
For example, you might have these versions installed:
@ -165,7 +168,7 @@ https://github.com/yyuu/pyenv-installer
This will get you going with the latest version of pyenv and make it
easy to fork and contribute any changes back upstream.
1. **Check out pyenv where you want it installed.**
1. **Check out pyenv where you want it installed.**
A good place to choose is `$HOME/.pyenv` (but you can install it somewhere else).
$ cd
@ -173,7 +176,7 @@ easy to fork and contribute any changes back upstream.
2. **Define environment variable `PYENV_ROOT`** to point to the path where
pyenv repo is cloned and add `$PYENV_ROOT/bin` to your `$PATH` for access
pyenv repo is cloned and add `$PYENV_ROOT/bin` to your `$PATH` for access
to the `pyenv` command-line utility.
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
@ -189,25 +192,25 @@ easy to fork and contribute any changes back upstream.
**Zsh note**: Modify your `~/.zshenv` file instead of `~/.bash_profile`.
**Ubuntu note**: Modify your `~/.bashrc` file instead of `~/.bash_profile`.
4. **Restart your shell so the path changes take effect.**
4. **Restart your shell so the path changes take effect.**
You can now begin using pyenv.
$ exec $SHELL
5. **Install Python versions into `$PYENV_ROOT/versions`.**
5. **Install Python versions into `$PYENV_ROOT/versions`.**
For example, to install Python 2.7.6, download and unpack the source, then run:
$ pyenv install 2.7.6
**NOTE:** If you need to pass configure option to build, please use
```CONFIGURE_OPTS``` environment variable.
**NOTE:** If you are having trouble installing a python version,
please visit the wiki page about
**NOTE:** If you are having trouble installing a python version,
please visit the wiki page about
[Common Build Problems](https://github.com/yyuu/pyenv/wiki/Common-build-problems)
6. **Rebuild the shim binaries.**
You should do this any time you install a new Python binary.
6. **Rebuild the shim binaries.**
You should do this any time you install a new Python binary.
(Examples: installing a new Python version, or installing a package that provides a binary.)
$ pyenv rehash
@ -234,7 +237,7 @@ To upgrade to a specific release of pyenv, check out the corresponding tag:
### Homebrew on Mac OS X
You can also install pyenv using the [Homebrew](http://brew.sh)
You can also install pyenv using the [Homebrew](http://brew.sh)
package manager for Mac OS X.
$ brew update
@ -288,8 +291,8 @@ As time goes on, you will accumulate Python versions in your
To remove old Python versions, `pyenv uninstall` command to automate
the removal process.
Alternatively, simply `rm -rf` the directory of the version you want
to remove. You can find the directory of a particular Python version
Alternatively, simply `rm -rf` the directory of the version you want
to remove. You can find the directory of a particular Python version
with the `pyenv prefix` command, e.g. `pyenv prefix 2.6.8`.
@ -306,10 +309,10 @@ See [COMMANDS.md](COMMANDS.md).
## Development
The pyenv source code is [hosted on GitHub](https://github.com/yyuu/pyenv).
The pyenv source code is [hosted on GitHub](https://github.com/yyuu/pyenv).
It's clean, modular, and easy to understand--even if you're not a shell hacker.
Please feel free to submit Pull Requests and report bugs on the
Please feel free to submit Pull Requests and report bugs on the
[issue tracker](https://github.com/yyuu/pyenv/issues).