{"id":13393871,"url":"https://github.com/pyenv/pyenv-virtualenv","last_synced_at":"2025-05-14T08:05:06.969Z","repository":{"id":7002223,"uuid":"8268387","full_name":"pyenv/pyenv-virtualenv","owner":"pyenv","description":"a pyenv plugin to manage virtualenv (a.k.a. python-virtualenv)","archived":false,"fork":false,"pushed_at":"2025-05-06T16:15:01.000Z","size":651,"stargazers_count":6567,"open_issues_count":99,"forks_count":421,"subscribers_count":73,"default_branch":"master","last_synced_at":"2025-05-14T08:03:28.261Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyenv.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["pyenv"],"patreon":null,"open_collective":"pyenv","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2013-02-18T12:59:17.000Z","updated_at":"2025-05-13T09:53:00.000Z","dependencies_parsed_at":"2024-04-14T23:51:56.956Z","dependency_job_id":"96320d6e-b933-46bd-a783-dd7687dddd6f","html_url":"https://github.com/pyenv/pyenv-virtualenv","commit_stats":{"total_commits":421,"total_committers":63,"mean_commits":6.682539682539683,"dds":0.6294536817102138,"last_synced_commit":"28cd9be54ef3be1cfe322af9f6f25c26d383e231"},"previous_names":["yyuu/pyenv-virtualenv"],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyenv%2Fpyenv-virtualenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyenv%2Fpyenv-virtualenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyenv%2Fpyenv-virtualenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyenv%2Fpyenv-virtualenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyenv","download_url":"https://codeload.github.com/pyenv/pyenv-virtualenv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101586,"owners_count":22014907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T17:01:01.668Z","updated_at":"2025-05-14T08:05:06.938Z","avatar_url":"https://github.com/pyenv.png","language":"Shell","readme":"# pyenv-virtualenv\n\n[![Join the chat at https://gitter.im/yyuu/pyenv-virtualenv](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/yyuu/pyenv-virtualenv?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n[![Build Status](https://travis-ci.org/pyenv/pyenv-virtualenv.svg?branch=master)](https://travis-ci.org/pyenv/pyenv-virtualenv)\n\npyenv-virtualenv is a [pyenv](https://github.com/pyenv/pyenv) plugin\nthat provides features to manage virtualenvs and conda environments\nfor Python on UNIX-like systems.\n\n(NOTICE: If you are an existing user of [virtualenvwrapper](http://pypi.python.org/pypi/virtualenvwrapper)\nand you love it, [pyenv-virtualenvwrapper](https://github.com/pyenv/pyenv-virtualenvwrapper) may help you\n(additionally) to manage your virtualenvs.)\n\n## Installation\n\n### Installing as a pyenv plugin\n\nThis will install the latest development version of pyenv-virtualenv into\nthe `$(pyenv root)/plugins/pyenv-virtualenv` directory.\n\n**Important note:**  If you installed pyenv into a non-standard directory, make\nsure that you clone this repo into the 'plugins' directory of wherever you\ninstalled into.\n\nFrom inside that directory you can:\n - Check out a specific release tag.\n - Get the latest development release by running `git pull` to download the\n   latest changes.\n\n1. **Check out pyenv-virtualenv into plugin directory**\n\n    ```bash\n    git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv\n    ```\n\n    For the Fish shell:\n\n    ```fish\n    git clone https://github.com/pyenv/pyenv-virtualenv.git (pyenv root)/plugins/pyenv-virtualenv\n    ```\n\n2. (OPTIONAL) **Add `pyenv virtualenv-init` to your shell** to enable auto-activation of virtualenvs. This is entirely optional but pretty useful. See \"Activate virtualenv\" below.\n\n    ```bash\n    echo 'eval \"$(pyenv virtualenv-init -)\"' \u003e\u003e ~/.bashrc\n    ```\n\n    **Fish shell note**:  Add this to your `~/.config/fish/config.fish`\n\n    ```fish\n    status --is-interactive; and pyenv virtualenv-init - | source\n    ```\n\n    **Zsh note**: Modify your `~/.zshrc` file instead of `~/.bashrc`.\n    \n3. **Restart your shell to enable pyenv-virtualenv**\n\n    ```bash\n    exec \"$SHELL\"\n    ```\n\n\n### Installing with Homebrew (for macOS users)\n\nmacOS users can install pyenv-virtualenv with the\n[Homebrew](https://brew.sh) package manager.\nThis will give you access to the `pyenv-virtualenv` command. If you have pyenv\ninstalled, you will also be able to use the `pyenv virtualenv` command.\n\n*This is the recommended method of installation if you installed pyenv\n with Homebrew.*\n\n```sh\nbrew install pyenv-virtualenv\n```\n\nOr, if you would like to install the latest development release:\n\n```sh\nbrew install --HEAD pyenv-virtualenv\n```\n\nAfter installation, you'll still need to do\n[Pyenv shell setup steps](https://github.com/pyenv/pyenv#basic-github-checkout)\nthen add \n```sh\neval \"$(pyenv virtualenv-init -)\"\n```\nto your shell's `.rc` file (as stated in the caveats). You'll only ever have to do this once.\n\n\n## Usage\n\n### Using `pyenv virtualenv` with pyenv\n\nTo create a virtualenv for the Python version used with pyenv, run\n`pyenv virtualenv`, specifying the Python version you want and the name\nof the virtualenv directory. For example,\n\n```sh\npyenv virtualenv 2.7.10 my-virtual-env-2.7.10\n```\n\nwill create a virtualenv based on Python 2.7.10 under `$(pyenv root)/versions` in a\nfolder called `my-virtual-env-2.7.10`.\n\n`pyenv virtualenv` forwards any options to the underlying command that actually\ncreates the virtual environment (`conda`, `virtualenv`, or `python -m venv`).\nSee the output of `pyenv virtualenv --help` for details.\n\n### Create virtualenv from current version\n\nIf there is only one argument given to `pyenv virtualenv`, the virtualenv will\nbe created with the given name based on the current pyenv Python version.\n\n```sh\n$ pyenv version\n3.4.3 (set by /home/yyuu/.pyenv/version)\n$ pyenv virtualenv venv34\n```\n\n\n### List existing virtualenvs\n\n`pyenv virtualenvs` shows you the list of existing virtualenvs and `conda` environments.\n\n```sh\n$ pyenv shell venv34\n$ pyenv virtualenvs\n  miniconda3-3.9.1 (created from /home/yyuu/.pyenv/versions/miniconda3-3.9.1)\n  miniconda3-3.9.1/envs/myenv (created from /home/yyuu/.pyenv/versions/miniconda3-3.9.1)\n  2.7.10/envs/my-virtual-env-2.7.10 (created from /home/yyuu/.pyenv/versions/2.7.10)\n  3.4.3/envs/venv34 (created from /home/yyuu/.pyenv/versions/3.4.3)\n  my-virtual-env-2.7.10 (created from /home/yyuu/.pyenv/versions/2.7.10)\n* venv34 (created from /home/yyuu/.pyenv/versions/3.4.3)\n```\n\nThere are two entries for each virtualenv, and the shorter one is just a symlink.\n\n\n### Activate virtualenv\n\nSome external tools (e.g. [jedi](https://github.com/davidhalter/jedi)) might\nrequire you to `activate` the virtualenv and `conda` environments.\n\nIf `eval \"$(pyenv virtualenv-init -)\"` is configured in your shell, `pyenv-virtualenv` will automatically activate/deactivate virtualenvs on entering/leaving directories which contain a `.python-version` file that contains the name of a valid virtual environment as shown in the output of `pyenv virtualenvs` (e.g., `venv34` or `3.4.3/envs/venv34` in example above) . `.python-version` files are used by pyenv to denote local Python versions and can be created and deleted with the [`pyenv local`](https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-local) command.\n\nYou can also activate and deactivate a pyenv virtualenv manually:\n\n```sh\npyenv activate \u003cname\u003e\npyenv deactivate\n```\n\n\n### Delete existing virtualenv\n\nRemoving the directories in `$(pyenv root)/versions` and `$(pyenv root)/versions/{version}/envs` will delete the virtualenv, or you can run:\n\n```sh\npyenv uninstall my-virtual-env\n```\n\nYou can also delete existing virtualenvs by using `virtualenv-delete` command, e.g. you can run:\n```sh\npyenv virtualenv-delete my-virtual-env\n```\nThis will delete virtualenv called `my-virtual-env`.\n\n\n### virtualenv and venv\n\nThere is a [venv](http://docs.python.org/3/library/venv.html) module available\nfor CPython 3.3 and newer.\nIt provides an executable module `venv` which is the successor of `virtualenv`\nand distributed by default.\n\n`pyenv-virtualenv` uses `python -m venv` if it is available and the `virtualenv`\ncommand is not available.\n\n\n### Anaconda and Miniconda\n\nYou can manage `conda` environments by `conda create` as same manner as standard Anaconda/Miniconda installations.\nTo use those environments, you can use `pyenv activate` and `pyenv deactivate`.\n\n```sh\n$ pyenv version\nminiconda3-3.9.1 (set by /home/yyuu/.pyenv/version)\n$ conda env list\n# conda environments:\n#\nmyenv                    /home/yyuu/.pyenv/versions/miniconda3-3.9.1/envs/myenv\nroot                  *  /home/yyuu/.pyenv/versions/miniconda3-3.9.1\n$ pyenv activate miniconda3-3.9.1/envs/myenv\ndiscarding /home/yyuu/.pyenv/versions/miniconda3-3.9.1/bin from PATH\nprepending /home/yyuu/.pyenv/versions/miniconda3-3.9.1/envs/myenv/bin to PATH\n$ python --version\nPython 3.4.3 :: Continuum Analytics, Inc.\n$ pyenv deactivate\ndiscarding /home/yyuu/.pyenv/versions/miniconda3-3.9.1/envs/myenv/bin from PATH\n```\n\nIf `conda` is available, `pyenv virtualenv` will use it to create environment by `conda create`.\n\n```sh\n$ pyenv version\nminiconda3-3.9.1 (set by /home/yyuu/.pyenv/version)\n$ pyenv virtualenv myenv2\n$ conda env list\n# conda environments:\n#\nmyenv                    /home/yyuu/.pyenv/versions/miniconda3-3.9.1/envs/myenv\nmyenv                    /home/yyuu/.pyenv/versions/miniconda3-3.9.1/envs/myenv2\nroot                  *  /home/yyuu/.pyenv/versions/miniconda3-3.9.1\n```\n\nYou can use version like `miniconda3-3.9.1/envs/myenv` to specify `conda` environment as a version in pyenv.\n\n```sh\n$ pyenv version\nminiconda3-3.9.1 (set by /home/yyuu/.pyenv/version)\n$ pyenv shell miniconda3-3.9.1/envs/myenv\n$ which python\n/home/yyuu/.pyenv/versions/miniconda3-3.9.1/envs/myenv/bin/python\n```\n\n\n### Special environment variables\n\nYou can set certain environment variables to control pyenv-virtualenv.\n\n* `PYENV_VIRTUALENV_CACHE_PATH`, if set, specifies a directory to use for\n  caching downloaded package files.\n* `VIRTUALENV_VERSION`, if set, forces pyenv-virtualenv to install the desired\n  version of virtualenv. If `virtualenv` has not been installed,\n  pyenv-virtualenv will try to install the given version of virtualenv.\n* `GET_PIP`, if set and `venv` is preferred over `virtualenv`,\n  use `get_pip.py` from the specified location.\n* `GET_PIP_URL`, if set and `venv` is preferred over\n  `virtualenv`, download `get_pip.py` from the specified URL.\n* `PIP_VERSION`, if set and `venv` is preferred\n  over `virtualenv`, install the specified version of pip.\n* `PYENV_VIRTUALENV_VERBOSE_ACTIVATE`, if set, shows some verbose outputs on activation and deactivation\n* `PYENV_VIRTUALENV_PROMPT`, if set, allows users to customize how `pyenv-virtualenv` modifies their shell prompt. The default prompt (\"(venv)\") is overwritten with any user-specified text. Specify the location of the virtual environment name with the string `{venv}`. For example, the default prompt string would be `({venv})`.\n\n## Version History\n\nSee [CHANGELOG.md](CHANGELOG.md).\n\n\n### License\n\n[(The MIT License)](LICENSE)\n\n* Copyright (c) 2015 Yamashita, Yuu\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":["https://github.com/sponsors/pyenv","https://opencollective.com/pyenv"],"categories":["Outdated Stuff","Shell","Virtual Environments","Prepare","pyenv","others","Plugins"],"sub_categories":["Plugins for pyenv"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyenv%2Fpyenv-virtualenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyenv%2Fpyenv-virtualenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyenv%2Fpyenv-virtualenv/lists"}