You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

180 lines
6.3 KiB

пре 11 година
пре 12 година
пре 11 година
пре 12 година
пре 11 година
пре 12 година
пре 12 година
пре 12 година
пре 11 година
пре 12 година
пре 12 година
пре 12 година
пре 12 година
пре 10 година
пре 12 година
пре 10 година
пре 12 година
пре 11 година
пре 10 година
пре 11 година
пре 11 година
пре 11 година
пре 10 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 12 година
пре 10 година
пре 10 година
пре 10 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 12 година
пре 12 година
пре 11 година
пре 12 година
  1. # pyenv-virtualenv (a.k.a. [python-virtualenv](https://github.com/yyuu/python-virtualenv))
  2. pyenv-virtualenv is a [pyenv](https://github.com/yyuu/pyenv) plugin
  3. that provides a `pyenv virtualenv` command to create virtualenv for Python
  4. on UNIX-like systems.
  5. (NOTICE: If you are an existing user of [virtualenvwrapper](http://pypi.python.org/pypi/virtualenvwrapper)
  6. and you love it, [pyenv-virtualenvwrapper](https://github.com/yyuu/pyenv-virtualenvwrapper) may help you
  7. to manage your virtualenvs.)
  8. ## Installation
  9. ### Installing as a pyenv plugin
  10. Installing pyenv-virtualenv as a pyenv plugin will give you access to the
  11. `pyenv virtualenv` command.
  12. $ git clone git://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
  13. This will install the latest development version of pyenv-virtualenv into
  14. the `~/.pyenv/plugins/pyenv-virtualenv` directory.
  15. **Important note:** If you installed pyenv into a non-standard directory, make sure that you clone this
  16. repo into the 'plugins' directory of wherever you installed into.
  17. From inside that directory you can:
  18. - Check out a specific release tag.
  19. - Get the latest development release by running `git pull` to download the latest changes.
  20. ### Installing with Homebrew (for OS X users)
  21. Mac OS X users can install pyenv-virtualenv with the
  22. [Homebrew](http://brew.sh) package manager. This
  23. will give you access to the `pyenv-virtualenv` command. If you have pyenv
  24. installed, you will also be able to use the `pyenv virtualenv` command.
  25. *This is recommended method of installation if you installed pyenv
  26. with Homebrew.*
  27. brew install pyenv-virtualenv
  28. Or, if you would like to install the latest development release:
  29. brew install --HEAD pyenv-virtualenv
  30. ## Usage
  31. ### Using `pyenv virtualenv` with pyenv
  32. To create a virtualenv for the Python version use with pyenv, run
  33. `pyenv virtualenv`, specifying the Python version you want and the name
  34. of the virtualenv directory. For example,
  35. $ pyenv virtualenv 2.7.6 my-virtual-env-2.7.6
  36. will create a virtualenv based on Python 2.7.6
  37. under `~/.pyenv/versions` in a folder called `my-virtual-env-2.7.6`.
  38. ### Create virtualenv from current version
  39. If there is only one argument is given to `pyenv virtualenv`,
  40. virtualenv will be created with given name based on current
  41. version.
  42. $ pyenv version
  43. 3.3.3 (set by /home/yyuu/.pyenv/version)
  44. $ pyenv virtualenv venv33
  45. ### List existing virtualenvs
  46. `pyenv virtualenvs` shows you the list of existing virtualenvs.
  47. $ pyenv shell venv27
  48. $ pyenv virtualenvs
  49. * venv27 (created from /home/yyuu/.pyenv/versions/2.7.6)
  50. venv33 (created from /home/yyuu/.pyenv/versions/3.3.3)
  51. ### Special environment variables
  52. You can set certain environment variables to control the pyenv-virtualenv.
  53. * `PYENV_VIRTUALENV_CACHE_PATH`, if set, specifies a directory to use for
  54. caching downloaded package files.
  55. * `VIRTUALENV_VERSION`, if set, forces pyenv-virtualenv to install desired
  56. version of virtualenv. If the virtualenv has not been installed,
  57. pyenv-virtualenv will try to install the given version of virtualenv.
  58. * `EZ_SETUP` and `GET_PIP`, if set and pyvenv is preferred than virtualenv,
  59. use `ez_setup.py` and `get_pip.py` at specified location.
  60. * `EZ_SETUP_URL` and `GET_PIP_URL`, if set and pyvenv is preferred
  61. than virtualenv, download `ez_setup.py` and `get_pip.py` from specified URL.
  62. * `SETUPTOOLS_VERSION` and `PIP_VERSION`, if set and pyvenv is preferred
  63. than virtualenv, install specified version of setuptools and pip.
  64. ## Version History
  65. #### 20140110.1
  66. * Fix install script
  67. #### 20140110
  68. * Support environment variables of `EZ_SETUP` and `GET_PIP`.
  69. * Support a short option `-p` of `virtualenv`.
  70. #### 20131216
  71. * Use latest release of setuptools and pip if the version not given via environment variables.
  72. #### 20130622
  73. * Removed bundled `virtualenv.py` script. Now pyenv-virtualenv installs `virtualenv` package into source version and then use it.
  74. * On Python 3.3+, use `pyvenv` as virtualenv command if `virtualenv` is not available.
  75. * Install setuptools and pip into environments created by `pyvenv`.
  76. #### 20130614
  77. * Add `pyenv virtualenvs` to list all virtualenv versions.
  78. * *EXPERIMENTAL*: Add `--upgrade` option to re-create virtualenv with migrating packages
  79. #### 20130527
  80. * Remove `python-virtualenv` which was no longer used.
  81. * Change the installation path of the `virtualenv.py` script. (`./libexec` -> `./libexec/pyenv-virtualenv/${VIRTUALENV_VERSION}`)
  82. * Download `virtualenv.py` if desired version has not been installed.
  83. #### 20130507
  84. * Display virtualenv information in `--help` and `--version`
  85. * Update virtualenv version; 1.8.4 -> 1.9.1
  86. #### 20130307
  87. * Rename the project; `s/python-virtualenv/pyenv-virtualenv/g`
  88. * The `pyenv-virtualenv` script is not depending on `python-virtualenv` now.
  89. `python-virtualenv` will left for compatibility and will not continue for future releases.
  90. * Update virtualenv version; 1.8.2 -> 1.8.4
  91. #### 20130218
  92. * Add pyenv 0.2.x (rbenv 0.4.x) style help messages.
  93. #### 20121023
  94. * Create virtualenv with exact name of python executables.
  95. * Changed command-line options of python-virtualenv.
  96. First argument should be a path to the python executable.
  97. * Add install script.
  98. #### 20120927
  99. * Initial public release.
  100. ### License
  101. (The MIT License)
  102. * Copyright (c) 2013 Yamashita, Yuu
  103. Permission is hereby granted, free of charge, to any person obtaining
  104. a copy of this software and associated documentation files (the
  105. "Software"), to deal in the Software without restriction, including
  106. without limitation the rights to use, copy, modify, merge, publish,
  107. distribute, sublicense, and/or sell copies of the Software, and to
  108. permit persons to whom the Software is furnished to do so, subject to
  109. the following conditions:
  110. The above copyright notice and this permission notice shall be
  111. included in all copies or substantial portions of the Software.
  112. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  113. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  114. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  115. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  116. LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  117. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  118. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.