We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
cache + virtualenv>=20 / python_venv + moving executables -> File not found: ... python
failure mode looks something like this:

```
Check for added large files..............................................Failed
- hook id: check-added-large-files
- exit code: 1

Executable `/Users/runner/.cache/pre-commit/repo14qw_y0i/py_env-python3.8/bin/python` not found
```

currently this is a common failure for github actions caches, there's ~2 ways to work around this:

1. [add `$(which python)`](https://github.com/pre-commit/action/commit/ee269b64a608de770696d23079f46238c2f7ab5a) to the pre-commit cache key
2. [manually bump](https://github.com/pypa/pip/pull/7750/files) the pre-commit cache key

but pre-commit should more gracefully detect this in the [`healthy()`](https://github.com/pre-commit/pre-commit/blob/0a8ba31b9b6656d90f94fc368b47acb502cea44d/pre_commit/languages/python.py#L160-L168) function (which is designed to catch these sorts of system breakages)

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pre_commit/languages/python.py`
Content:
```
1 import contextlib
2 import functools
3 import os
4 import sys
5 from typing import Callable
6 from typing import ContextManager
7 from typing import Generator
8 from typing import Optional
9 from typing import Sequence
10 from typing import Tuple
11 
12 import pre_commit.constants as C
13 from pre_commit.envcontext import envcontext
14 from pre_commit.envcontext import PatchesT
15 from pre_commit.envcontext import UNSET
16 from pre_commit.envcontext import Var
17 from pre_commit.hook import Hook
18 from pre_commit.languages import helpers
19 from pre_commit.parse_shebang import find_executable
20 from pre_commit.prefix import Prefix
21 from pre_commit.util import CalledProcessError
22 from pre_commit.util import clean_path_on_failure
23 from pre_commit.util import cmd_output
24 from pre_commit.util import cmd_output_b
25 
26 ENVIRONMENT_DIR = 'py_env'
27 
28 
29 def bin_dir(venv: str) -> str:
30     """On windows there's a different directory for the virtualenv"""
31     bin_part = 'Scripts' if os.name == 'nt' else 'bin'
32     return os.path.join(venv, bin_part)
33 
34 
35 def get_env_patch(venv: str) -> PatchesT:
36     return (
37         ('PYTHONHOME', UNSET),
38         ('VIRTUAL_ENV', venv),
39         ('PATH', (bin_dir(venv), os.pathsep, Var('PATH'))),
40     )
41 
42 
43 def _find_by_py_launcher(
44         version: str,
45 ) -> Optional[str]:  # pragma: no cover (windows only)
46     if version.startswith('python'):
47         num = version[len('python'):]
48         try:
49             cmd = ('py', f'-{num}', '-c', 'import sys; print(sys.executable)')
50             return cmd_output(*cmd)[1].strip()
51         except CalledProcessError:
52             pass
53     return None
54 
55 
56 def _find_by_sys_executable() -> Optional[str]:
57     def _norm(path: str) -> Optional[str]:
58         _, exe = os.path.split(path.lower())
59         exe, _, _ = exe.partition('.exe')
60         if exe not in {'python', 'pythonw'} and find_executable(exe):
61             return exe
62         return None
63 
64     # On linux, I see these common sys.executables:
65     #
66     # system `python`: /usr/bin/python -> python2.7
67     # system `python2`: /usr/bin/python2 -> python2.7
68     # virtualenv v: v/bin/python (will not return from this loop)
69     # virtualenv v -ppython2: v/bin/python -> python2
70     # virtualenv v -ppython2.7: v/bin/python -> python2.7
71     # virtualenv v -ppypy: v/bin/python -> v/bin/pypy
72     for path in (sys.executable, os.path.realpath(sys.executable)):
73         exe = _norm(path)
74         if exe:
75             return exe
76     return None
77 
78 
79 @functools.lru_cache(maxsize=1)
80 def get_default_version() -> str:  # pragma: no cover (platform dependent)
81     # First attempt from `sys.executable` (or the realpath)
82     exe = _find_by_sys_executable()
83     if exe:
84         return exe
85 
86     # Next try the `pythonX.X` executable
87     exe = f'python{sys.version_info[0]}.{sys.version_info[1]}'
88     if find_executable(exe):
89         return exe
90 
91     if _find_by_py_launcher(exe):
92         return exe
93 
94     # Give a best-effort try for windows
95     default_folder_name = exe.replace('.', '')
96     if os.path.exists(fr'C:\{default_folder_name}\python.exe'):
97         return exe
98 
99     # We tried!
100     return C.DEFAULT
101 
102 
103 def _sys_executable_matches(version: str) -> bool:
104     if version == 'python':
105         return True
106     elif not version.startswith('python'):
107         return False
108 
109     try:
110         info = tuple(int(p) for p in version[len('python'):].split('.'))
111     except ValueError:
112         return False
113 
114     return sys.version_info[:len(info)] == info
115 
116 
117 def norm_version(version: str) -> str:
118     # first see if our current executable is appropriate
119     if _sys_executable_matches(version):
120         return sys.executable
121 
122     if os.name == 'nt':  # pragma: no cover (windows)
123         version_exec = _find_by_py_launcher(version)
124         if version_exec:
125             return version_exec
126 
127         # Try looking up by name
128         version_exec = find_executable(version)
129         if version_exec and version_exec != version:
130             return version_exec
131 
132         # If it is in the form pythonx.x search in the default
133         # place on windows
134         if version.startswith('python'):
135             default_folder_name = version.replace('.', '')
136             return fr'C:\{default_folder_name}\python.exe'
137 
138     # Otherwise assume it is a path
139     return os.path.expanduser(version)
140 
141 
142 def py_interface(
143         _dir: str,
144         _make_venv: Callable[[str, str], None],
145 ) -> Tuple[
146     Callable[[Prefix, str], ContextManager[None]],
147     Callable[[Prefix, str], bool],
148     Callable[[Hook, Sequence[str], bool], Tuple[int, bytes]],
149     Callable[[Prefix, str, Sequence[str]], None],
150 ]:
151     @contextlib.contextmanager
152     def in_env(
153             prefix: Prefix,
154             language_version: str,
155     ) -> Generator[None, None, None]:
156         envdir = prefix.path(helpers.environment_dir(_dir, language_version))
157         with envcontext(get_env_patch(envdir)):
158             yield
159 
160     def healthy(prefix: Prefix, language_version: str) -> bool:
161         with in_env(prefix, language_version):
162             retcode, _, _ = cmd_output_b(
163                 'python', '-c',
164                 'import ctypes, datetime, io, os, ssl, weakref',
165                 cwd='/',
166                 retcode=None,
167             )
168         return retcode == 0
169 
170     def run_hook(
171             hook: Hook,
172             file_args: Sequence[str],
173             color: bool,
174     ) -> Tuple[int, bytes]:
175         with in_env(hook.prefix, hook.language_version):
176             return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
177 
178     def install_environment(
179             prefix: Prefix,
180             version: str,
181             additional_dependencies: Sequence[str],
182     ) -> None:
183         additional_dependencies = tuple(additional_dependencies)
184         directory = helpers.environment_dir(_dir, version)
185 
186         env_dir = prefix.path(directory)
187         with clean_path_on_failure(env_dir):
188             if version != C.DEFAULT:
189                 python = norm_version(version)
190             else:
191                 python = os.path.realpath(sys.executable)
192             _make_venv(env_dir, python)
193             with in_env(prefix, version):
194                 helpers.run_setup_cmd(
195                     prefix, ('pip', 'install', '.') + additional_dependencies,
196                 )
197 
198     return in_env, healthy, run_hook, install_environment
199 
200 
201 def make_venv(envdir: str, python: str) -> None:
202     env = dict(os.environ, VIRTUALENV_NO_DOWNLOAD='1')
203     cmd = (sys.executable, '-mvirtualenv', envdir, '-p', python)
204     cmd_output_b(*cmd, env=env, cwd='/')
205 
206 
207 _interface = py_interface(ENVIRONMENT_DIR, make_venv)
208 in_env, healthy, run_hook, install_environment = _interface
209
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pre_commit/languages/python.py b/pre_commit/languages/python.py
--- a/pre_commit/languages/python.py
+++ b/pre_commit/languages/python.py
@@ -158,10 +158,12 @@
             yield
 
     def healthy(prefix: Prefix, language_version: str) -> bool:
+        envdir = helpers.environment_dir(_dir, language_version)
+        exe_name = 'python.exe' if sys.platform == 'win32' else 'python'
+        py_exe = prefix.path(bin_dir(envdir), exe_name)
         with in_env(prefix, language_version):
             retcode, _, _ = cmd_output_b(
-                'python', '-c',
-                'import ctypes, datetime, io, os, ssl, weakref',
+                py_exe, '-c', 'import ctypes, datetime, io, os, ssl, weakref',
                 cwd='/',
                 retcode=None,
             )

{"golden_diff": "diff --git a/pre_commit/languages/python.py b/pre_commit/languages/python.py\n--- a/pre_commit/languages/python.py\n+++ b/pre_commit/languages/python.py\n@@ -158,10 +158,12 @@\n             yield\n \n     def healthy(prefix: Prefix, language_version: str) -> bool:\n+        envdir = helpers.environment_dir(_dir, language_version)\n+        exe_name = 'python.exe' if sys.platform == 'win32' else 'python'\n+        py_exe = prefix.path(bin_dir(envdir), exe_name)\n         with in_env(prefix, language_version):\n             retcode, _, _ = cmd_output_b(\n-                'python', '-c',\n-                'import ctypes, datetime, io, os, ssl, weakref',\n+                py_exe, '-c', 'import ctypes, datetime, io, os, ssl, weakref',\n                 cwd='/',\n                 retcode=None,\n             )\n", "issue": "cache + virtualenv>=20 / python_venv + moving executables -> File not found: ... python\nfailure mode looks something like this:\r\n\r\n```\r\nCheck for added large files..............................................Failed\r\n- hook id: check-added-large-files\r\n- exit code: 1\r\n\r\nExecutable `/Users/runner/.cache/pre-commit/repo14qw_y0i/py_env-python3.8/bin/python` not found\r\n```\r\n\r\ncurrently this is a common failure for github actions caches, there's ~2 ways to work around this:\r\n\r\n1. [add `$(which python)`](https://github.com/pre-commit/action/commit/ee269b64a608de770696d23079f46238c2f7ab5a) to the pre-commit cache key\r\n2. [manually bump](https://github.com/pypa/pip/pull/7750/files) the pre-commit cache key\r\n\r\nbut pre-commit should more gracefully detect this in the [`healthy()`](https://github.com/pre-commit/pre-commit/blob/0a8ba31b9b6656d90f94fc368b47acb502cea44d/pre_commit/languages/python.py#L160-L168) function (which is designed to catch these sorts of system breakages)\n", "before_files": [{"content": "import contextlib\nimport functools\nimport os\nimport sys\nfrom typing import Callable\nfrom typing import ContextManager\nfrom typing import Generator\nfrom typing import Optional\nfrom typing import Sequence\nfrom typing import Tuple\n\nimport pre_commit.constants as C\nfrom pre_commit.envcontext import envcontext\nfrom pre_commit.envcontext import PatchesT\nfrom pre_commit.envcontext import UNSET\nfrom pre_commit.envcontext import Var\nfrom pre_commit.hook import Hook\nfrom pre_commit.languages import helpers\nfrom pre_commit.parse_shebang import find_executable\nfrom pre_commit.prefix import Prefix\nfrom pre_commit.util import CalledProcessError\nfrom pre_commit.util import clean_path_on_failure\nfrom pre_commit.util import cmd_output\nfrom pre_commit.util import cmd_output_b\n\nENVIRONMENT_DIR = 'py_env'\n\n\ndef bin_dir(venv: str) -> str:\n    \"\"\"On windows there's a different directory for the virtualenv\"\"\"\n    bin_part = 'Scripts' if os.name == 'nt' else 'bin'\n    return os.path.join(venv, bin_part)\n\n\ndef get_env_patch(venv: str) -> PatchesT:\n    return (\n        ('PYTHONHOME', UNSET),\n        ('VIRTUAL_ENV', venv),\n        ('PATH', (bin_dir(venv), os.pathsep, Var('PATH'))),\n    )\n\n\ndef _find_by_py_launcher(\n        version: str,\n) -> Optional[str]:  # pragma: no cover (windows only)\n    if version.startswith('python'):\n        num = version[len('python'):]\n        try:\n            cmd = ('py', f'-{num}', '-c', 'import sys; print(sys.executable)')\n            return cmd_output(*cmd)[1].strip()\n        except CalledProcessError:\n            pass\n    return None\n\n\ndef _find_by_sys_executable() -> Optional[str]:\n    def _norm(path: str) -> Optional[str]:\n        _, exe = os.path.split(path.lower())\n        exe, _, _ = exe.partition('.exe')\n        if exe not in {'python', 'pythonw'} and find_executable(exe):\n            return exe\n        return None\n\n    # On linux, I see these common sys.executables:\n    #\n    # system `python`: /usr/bin/python -> python2.7\n    # system `python2`: /usr/bin/python2 -> python2.7\n    # virtualenv v: v/bin/python (will not return from this loop)\n    # virtualenv v -ppython2: v/bin/python -> python2\n    # virtualenv v -ppython2.7: v/bin/python -> python2.7\n    # virtualenv v -ppypy: v/bin/python -> v/bin/pypy\n    for path in (sys.executable, os.path.realpath(sys.executable)):\n        exe = _norm(path)\n        if exe:\n            return exe\n    return None\n\n\n@functools.lru_cache(maxsize=1)\ndef get_default_version() -> str:  # pragma: no cover (platform dependent)\n    # First attempt from `sys.executable` (or the realpath)\n    exe = _find_by_sys_executable()\n    if exe:\n        return exe\n\n    # Next try the `pythonX.X` executable\n    exe = f'python{sys.version_info[0]}.{sys.version_info[1]}'\n    if find_executable(exe):\n        return exe\n\n    if _find_by_py_launcher(exe):\n        return exe\n\n    # Give a best-effort try for windows\n    default_folder_name = exe.replace('.', '')\n    if os.path.exists(fr'C:\\{default_folder_name}\\python.exe'):\n        return exe\n\n    # We tried!\n    return C.DEFAULT\n\n\ndef _sys_executable_matches(version: str) -> bool:\n    if version == 'python':\n        return True\n    elif not version.startswith('python'):\n        return False\n\n    try:\n        info = tuple(int(p) for p in version[len('python'):].split('.'))\n    except ValueError:\n        return False\n\n    return sys.version_info[:len(info)] == info\n\n\ndef norm_version(version: str) -> str:\n    # first see if our current executable is appropriate\n    if _sys_executable_matches(version):\n        return sys.executable\n\n    if os.name == 'nt':  # pragma: no cover (windows)\n        version_exec = _find_by_py_launcher(version)\n        if version_exec:\n            return version_exec\n\n        # Try looking up by name\n        version_exec = find_executable(version)\n        if version_exec and version_exec != version:\n            return version_exec\n\n        # If it is in the form pythonx.x search in the default\n        # place on windows\n        if version.startswith('python'):\n            default_folder_name = version.replace('.', '')\n            return fr'C:\\{default_folder_name}\\python.exe'\n\n    # Otherwise assume it is a path\n    return os.path.expanduser(version)\n\n\ndef py_interface(\n        _dir: str,\n        _make_venv: Callable[[str, str], None],\n) -> Tuple[\n    Callable[[Prefix, str], ContextManager[None]],\n    Callable[[Prefix, str], bool],\n    Callable[[Hook, Sequence[str], bool], Tuple[int, bytes]],\n    Callable[[Prefix, str, Sequence[str]], None],\n]:\n    @contextlib.contextmanager\n    def in_env(\n            prefix: Prefix,\n            language_version: str,\n    ) -> Generator[None, None, None]:\n        envdir = prefix.path(helpers.environment_dir(_dir, language_version))\n        with envcontext(get_env_patch(envdir)):\n            yield\n\n    def healthy(prefix: Prefix, language_version: str) -> bool:\n        with in_env(prefix, language_version):\n            retcode, _, _ = cmd_output_b(\n                'python', '-c',\n                'import ctypes, datetime, io, os, ssl, weakref',\n                cwd='/',\n                retcode=None,\n            )\n        return retcode == 0\n\n    def run_hook(\n            hook: Hook,\n            file_args: Sequence[str],\n            color: bool,\n    ) -> Tuple[int, bytes]:\n        with in_env(hook.prefix, hook.language_version):\n            return helpers.run_xargs(hook, hook.cmd, file_args, color=color)\n\n    def install_environment(\n            prefix: Prefix,\n            version: str,\n            additional_dependencies: Sequence[str],\n    ) -> None:\n        additional_dependencies = tuple(additional_dependencies)\n        directory = helpers.environment_dir(_dir, version)\n\n        env_dir = prefix.path(directory)\n        with clean_path_on_failure(env_dir):\n            if version != C.DEFAULT:\n                python = norm_version(version)\n            else:\n                python = os.path.realpath(sys.executable)\n            _make_venv(env_dir, python)\n            with in_env(prefix, version):\n                helpers.run_setup_cmd(\n                    prefix, ('pip', 'install', '.') + additional_dependencies,\n                )\n\n    return in_env, healthy, run_hook, install_environment\n\n\ndef make_venv(envdir: str, python: str) -> None:\n    env = dict(os.environ, VIRTUALENV_NO_DOWNLOAD='1')\n    cmd = (sys.executable, '-mvirtualenv', envdir, '-p', python)\n    cmd_output_b(*cmd, env=env, cwd='/')\n\n\n_interface = py_interface(ENVIRONMENT_DIR, make_venv)\nin_env, healthy, run_hook, install_environment = _interface\n", "path": "pre_commit/languages/python.py"}], "after_files": [{"content": "import contextlib\nimport functools\nimport os\nimport sys\nfrom typing import Callable\nfrom typing import ContextManager\nfrom typing import Generator\nfrom typing import Optional\nfrom typing import Sequence\nfrom typing import Tuple\n\nimport pre_commit.constants as C\nfrom pre_commit.envcontext import envcontext\nfrom pre_commit.envcontext import PatchesT\nfrom pre_commit.envcontext import UNSET\nfrom pre_commit.envcontext import Var\nfrom pre_commit.hook import Hook\nfrom pre_commit.languages import helpers\nfrom pre_commit.parse_shebang import find_executable\nfrom pre_commit.prefix import Prefix\nfrom pre_commit.util import CalledProcessError\nfrom pre_commit.util import clean_path_on_failure\nfrom pre_commit.util import cmd_output\nfrom pre_commit.util import cmd_output_b\n\nENVIRONMENT_DIR = 'py_env'\n\n\ndef bin_dir(venv: str) -> str:\n    \"\"\"On windows there's a different directory for the virtualenv\"\"\"\n    bin_part = 'Scripts' if os.name == 'nt' else 'bin'\n    return os.path.join(venv, bin_part)\n\n\ndef get_env_patch(venv: str) -> PatchesT:\n    return (\n        ('PYTHONHOME', UNSET),\n        ('VIRTUAL_ENV', venv),\n        ('PATH', (bin_dir(venv), os.pathsep, Var('PATH'))),\n    )\n\n\ndef _find_by_py_launcher(\n        version: str,\n) -> Optional[str]:  # pragma: no cover (windows only)\n    if version.startswith('python'):\n        num = version[len('python'):]\n        try:\n            cmd = ('py', f'-{num}', '-c', 'import sys; print(sys.executable)')\n            return cmd_output(*cmd)[1].strip()\n        except CalledProcessError:\n            pass\n    return None\n\n\ndef _find_by_sys_executable() -> Optional[str]:\n    def _norm(path: str) -> Optional[str]:\n        _, exe = os.path.split(path.lower())\n        exe, _, _ = exe.partition('.exe')\n        if exe not in {'python', 'pythonw'} and find_executable(exe):\n            return exe\n        return None\n\n    # On linux, I see these common sys.executables:\n    #\n    # system `python`: /usr/bin/python -> python2.7\n    # system `python2`: /usr/bin/python2 -> python2.7\n    # virtualenv v: v/bin/python (will not return from this loop)\n    # virtualenv v -ppython2: v/bin/python -> python2\n    # virtualenv v -ppython2.7: v/bin/python -> python2.7\n    # virtualenv v -ppypy: v/bin/python -> v/bin/pypy\n    for path in (sys.executable, os.path.realpath(sys.executable)):\n        exe = _norm(path)\n        if exe:\n            return exe\n    return None\n\n\n@functools.lru_cache(maxsize=1)\ndef get_default_version() -> str:  # pragma: no cover (platform dependent)\n    # First attempt from `sys.executable` (or the realpath)\n    exe = _find_by_sys_executable()\n    if exe:\n        return exe\n\n    # Next try the `pythonX.X` executable\n    exe = f'python{sys.version_info[0]}.{sys.version_info[1]}'\n    if find_executable(exe):\n        return exe\n\n    if _find_by_py_launcher(exe):\n        return exe\n\n    # Give a best-effort try for windows\n    default_folder_name = exe.replace('.', '')\n    if os.path.exists(fr'C:\\{default_folder_name}\\python.exe'):\n        return exe\n\n    # We tried!\n    return C.DEFAULT\n\n\ndef _sys_executable_matches(version: str) -> bool:\n    if version == 'python':\n        return True\n    elif not version.startswith('python'):\n        return False\n\n    try:\n        info = tuple(int(p) for p in version[len('python'):].split('.'))\n    except ValueError:\n        return False\n\n    return sys.version_info[:len(info)] == info\n\n\ndef norm_version(version: str) -> str:\n    # first see if our current executable is appropriate\n    if _sys_executable_matches(version):\n        return sys.executable\n\n    if os.name == 'nt':  # pragma: no cover (windows)\n        version_exec = _find_by_py_launcher(version)\n        if version_exec:\n            return version_exec\n\n        # Try looking up by name\n        version_exec = find_executable(version)\n        if version_exec and version_exec != version:\n            return version_exec\n\n        # If it is in the form pythonx.x search in the default\n        # place on windows\n        if version.startswith('python'):\n            default_folder_name = version.replace('.', '')\n            return fr'C:\\{default_folder_name}\\python.exe'\n\n    # Otherwise assume it is a path\n    return os.path.expanduser(version)\n\n\ndef py_interface(\n        _dir: str,\n        _make_venv: Callable[[str, str], None],\n) -> Tuple[\n    Callable[[Prefix, str], ContextManager[None]],\n    Callable[[Prefix, str], bool],\n    Callable[[Hook, Sequence[str], bool], Tuple[int, bytes]],\n    Callable[[Prefix, str, Sequence[str]], None],\n]:\n    @contextlib.contextmanager\n    def in_env(\n            prefix: Prefix,\n            language_version: str,\n    ) -> Generator[None, None, None]:\n        envdir = prefix.path(helpers.environment_dir(_dir, language_version))\n        with envcontext(get_env_patch(envdir)):\n            yield\n\n    def healthy(prefix: Prefix, language_version: str) -> bool:\n        envdir = helpers.environment_dir(_dir, language_version)\n        exe_name = 'python.exe' if sys.platform == 'win32' else 'python'\n        py_exe = prefix.path(bin_dir(envdir), exe_name)\n        with in_env(prefix, language_version):\n            retcode, _, _ = cmd_output_b(\n                py_exe, '-c', 'import ctypes, datetime, io, os, ssl, weakref',\n                cwd='/',\n                retcode=None,\n            )\n        return retcode == 0\n\n    def run_hook(\n            hook: Hook,\n            file_args: Sequence[str],\n            color: bool,\n    ) -> Tuple[int, bytes]:\n        with in_env(hook.prefix, hook.language_version):\n            return helpers.run_xargs(hook, hook.cmd, file_args, color=color)\n\n    def install_environment(\n            prefix: Prefix,\n            version: str,\n            additional_dependencies: Sequence[str],\n    ) -> None:\n        additional_dependencies = tuple(additional_dependencies)\n        directory = helpers.environment_dir(_dir, version)\n\n        env_dir = prefix.path(directory)\n        with clean_path_on_failure(env_dir):\n            if version != C.DEFAULT:\n                python = norm_version(version)\n            else:\n                python = os.path.realpath(sys.executable)\n            _make_venv(env_dir, python)\n            with in_env(prefix, version):\n                helpers.run_setup_cmd(\n                    prefix, ('pip', 'install', '.') + additional_dependencies,\n                )\n\n    return in_env, healthy, run_hook, install_environment\n\n\ndef make_venv(envdir: str, python: str) -> None:\n    env = dict(os.environ, VIRTUALENV_NO_DOWNLOAD='1')\n    cmd = (sys.executable, '-mvirtualenv', envdir, '-p', python)\n    cmd_output_b(*cmd, env=env, cwd='/')\n\n\n_interface = py_interface(ENVIRONMENT_DIR, make_venv)\nin_env, healthy, run_hook, install_environment = _interface\n", "path": "pre_commit/languages/python.py"}]}