{
    "mode": "pydoc",
    "parameter": "virtualenv",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/virtualenv/json",
    "generated": "2026-06-02T13:19:29Z",
    "sections": {
        "NAME": {
            "content": "virtualenv\n",
            "subsections": []
        },
        "PACKAGE CONTENTS": {
            "content": "main\nactivation (package)\nappdata (package)\nconfig (package)\ncreate (package)\ndiscovery (package)\ninfo\nreport\nrun (package)\nseed (package)\nutil (package)\nversion\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "cli_run",
                    "content": "Create a virtual environment given some command line interface arguments.\n\n:param args: the command line arguments\n:param options: passing in a ``VirtualEnvOptions`` object allows return of the parsed options\n:param setuplogging: ``True`` if setup logging handlers, ``False`` to use handlers already registered\n:param env: environment variables to use\n:return: the session object of the creation (its structure for now is experimental and might change on short notice)\n"
                },
                {
                    "name": "session_via_cli",
                    "content": "Create a virtualenv session (same as clirun, but this does not perform the creation). Use this if you just want to\nquery what the virtual environment would look like, but not actually create it.\n\n:param args: the command line arguments\n:param options: passing in a ``VirtualEnvOptions`` object allows return of the parsed options\n:param setuplogging: ``True`` if setup logging handlers, ``False`` to use handlers already registered\n:param env: environment variables to use\n:return: the session object of the creation (its structure for now is experimental and might change on short notice)\n"
                }
            ]
        },
        "DATA": {
            "content": "all = ('version', 'clirun', 'sessionviacli')\n",
            "subsections": []
        },
        "VERSION": {
            "content": "20.13.0+ds\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3/dist-packages/virtualenv/init.py\n\n",
            "subsections": []
        }
    },
    "summary": "virtualenv",
    "flags": [],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Create virtual isolated Python environments.",
        "examples": [
            {
                "description": "Create a new environment",
                "command": "virtualenv {{path/to/venv}}"
            },
            {
                "description": "Customize the prompt prefix",
                "command": "virtualenv --prompt {{prompt_prefix}} {{path/to/venv}}"
            },
            {
                "description": "Use a different version of Python with virtualenv",
                "command": "virtualenv {{-p|--python}} {{path/to/pythonbin}} {{path/to/venv}}"
            },
            {
                "description": "Start (select) the environment",
                "command": "source {{path/to/venv}}/bin/activate"
            },
            {
                "description": "Stop the environment",
                "command": "deactivate"
            }
        ]
    }
}