Yamashita Yuu 39ce4e76fd | vor 10 Jahren | |
---|---|---|
bin | vor 10 Jahren | |
test | vor 10 Jahren | |
.gitignore | vor 11 Jahren | |
.travis.yml | vor 10 Jahren | |
LICENSE | vor 11 Jahren | |
README.md | vor 10 Jahren | |
install.sh | vor 10 Jahren |
pyenv-virtualenv is a pyenv plugin
that provides a pyenv virtualenv
command to create virtualenv for Python
on UNIX-like systems.
(NOTICE: If you are an existing user of virtualenvwrapper and you love it, pyenv-virtualenvwrapper may help you to manage your virtualenvs.)
Installing pyenv-virtualenv as a pyenv plugin will give you access to the
pyenv virtualenv
command.
$ git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
This will install the latest development version of pyenv-virtualenv into
the ~/.pyenv/plugins/pyenv-virtualenv
directory.
Important note: If you installed pyenv into a non-standard directory, make sure that you clone this
repo into the 'plugins' directory of wherever you installed into.
From inside that directory you can:
git pull
to download the latest changes.Mac OS X users can install pyenv-virtualenv with the
Homebrew package manager. This
will give you access to the pyenv-virtualenv
command. If you have pyenv
installed, you will also be able to use the pyenv virtualenv
command.
This is recommended method of installation if you installed pyenv with Homebrew.
brew install pyenv-virtualenv
Or, if you would like to install the latest development release:
brew install --HEAD pyenv-virtualenv
pyenv virtualenv
with pyenvTo create a virtualenv for the Python version use with pyenv, run
pyenv virtualenv
, specifying the Python version you want and the name
of the virtualenv directory. For example,
$ pyenv virtualenv 2.7.6 my-virtual-env-2.7.6
will create a virtualenv based on Python 2.7.6
under ~/.pyenv/versions
in a folder called my-virtual-env-2.7.6
.
If there is only one argument is given to pyenv virtualenv
,
virtualenv will be created with given name based on current
version.
$ pyenv version
3.3.3 (set by /home/yyuu/.pyenv/version)
$ pyenv virtualenv venv33
pyenv virtualenvs
shows you the list of existing virtualenvs.
$ pyenv shell venv27
$ pyenv virtualenvs
* venv27 (created from /home/yyuu/.pyenv/versions/2.7.6)
venv33 (created from /home/yyuu/.pyenv/versions/3.3.3)
Some external tools (e.g. jedi) might require you to activate
the virtualenv.
pyenv activate
lets you to activate the virtualenv into your shell.
$ pyenv activate venv27
pyenv activate
acts almost like following commands.
$ pyenv shell venv27
$ source "$(pyenv prefix venv27)/bin/activate"
You can deactivate the activate'd virtualenv by pyenv deactivate
.
$ pyenv deactivate
You can set certain environment variables to control the pyenv-virtualenv.
PYENV_VIRTUALENV_CACHE_PATH
, if set, specifies a directory to use for
caching downloaded package files.VIRTUALENV_VERSION
, if set, forces pyenv-virtualenv to install desired
version of virtualenv. If the virtualenv has not been installed,
pyenv-virtualenv will try to install the given version of virtualenv.EZ_SETUP
and GET_PIP
, if set and pyvenv is preferred than virtualenv,
use ez_setup.py
and get_pip.py
at specified location.EZ_SETUP_URL
and GET_PIP_URL
, if set and pyvenv is preferred
than virtualenv, download ez_setup.py
and get_pip.py
from specified URL.SETUPTOOLS_VERSION
and PIP_VERSION
, if set and pyvenv is preferred
than virtualenv, install specified version of setuptools and pip.activate
and deactivate
to make pyenv-virtualenv
work with jedi (#9)ensurepip
to install pip
if it is availablePIP_REQUIRE_VENV
to avoid problem on the installation of virtualenv
(#10)EZ_SETUP
and GET_PIP
.-p
of virtualenv
.virtualenv.py
script. Now pyenv-virtualenv installs virtualenv
package into source version and then use it.pyvenv
as virtualenv command if virtualenv
is not available.pyvenv
.pyenv virtualenvs
to list all virtualenv versions.--upgrade
option to re-create virtualenv with migrating packagespython-virtualenv
which was no longer used.virtualenv.py
script. (./libexec
-> ./libexec/pyenv-virtualenv/${VIRTUALENV_VERSION}
)virtualenv.py
if desired version has not been installed.--help
and --version
s/python-virtualenv/pyenv-virtualenv/g
pyenv-virtualenv
script is not depending on python-virtualenv
now.
python-virtualenv
will left for compatibility and will not continue for future releases.(The MIT License)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.