Repository: pypa/virtualenv

Issue:
`try-first-with` behaves differently for `--python` full paths and version specs
**Issue**

Describe what's the expected behaviour and what you're observing.

`--try-first-with` (and corresponding `try_first_with` config var) is described as "try first these interpreters before starting the discovery".

When using it, I observe a different behavior for it, depending on whether I use `--python` arg with a full interpreter path, or just a version specification.

Running `virtualenv` version `20.24.6`.

This creates a `python3.8` environment:

```
$ virtualenv --clear aaa --try-first-with=/usr/bin/python3.10 -p python3.8
created virtual environment CPython3.8.10.final.0-64 in 542ms
...
```

This creates a `python3.10` environment:

```
$ virtualenv --clear aaa --try-first-with=/usr/bin/python3.10 -p /usr/bin/python3.8
created virtual environment CPython3.10.13.final.0-64 in 525ms
...
```

The issue is that the behavior is different, and it's difficult to say what is the expected one. Documentation doesn't even mention the `try_first_with` config, nor does the help for the `--python` arg.

**Environment**

Provide at least:

- OS: Ubuntu 20.04
- `pip list` of the host python where `virtualenv` is installed:

```console
Package      Version
------------ -------
distlib      0.3.7
filelock     3.12.4
pip          23.0.1
platformdirs 3.11.0
setuptools   65.5.0
virtualenv   20.24.6
```

Tested in a clean virtualenv based on Python 3.10.

**Output of the virtual environment creation**

Make sure to run the creation with `-vvv --with-traceback`:

For `-p` with version spec:

```console
102 setup logging to NOTSET [DEBUG report:37]
106 find interpreter for spec PythonSpec(major=3, minor=8) [INFO builtin:58]
107 Attempting to acquire lock 140469522451232 on /home/.local/share/virtualenv/py_info/1/8a94588eda9d64d9e9a351ab8144e55b1fabf5113b54e67dd26a8c27df0381b3.lock [DEBUG _api:219]
107 Lock 140469522451232 acquired on /home/.local/share/virtualenv/py_info/1/8a94588eda9d64d9e9a351ab8144e55b1fabf5113b54e67dd26a8c27df0381b3.lock [DEBUG _api:222]
107 got python info of %s from (PosixPath('/usr/bin/python3.10'), PosixPath('/home/.local/share/virtualenv/py_info/1/8a94588eda9d64d9e9a351ab8144e55b1fabf5113b54e67dd26a8c27df0381b3.json')) [DEBUG via_disk_folder:131]
108 Attempting to release lock 140469522451232 on /home/.local/share/virtualenv/py_info/1/8a94588eda9d64d9e9a351ab8144e55b1fabf5113b54e67dd26a8c27df0381b3.lock [DEBUG _api:251]
108 Lock 140469522451232 released on /home/.local/share/virtualenv/py_info/1/8a94588eda9d64d9e9a351ab8144e55b1fabf5113b54e67dd26a8c27df0381b3.lock [DEBUG _api:254]
108 proposed PythonInfo(spec=CPython3.10.13.final.0-64, exe=/usr/bin/python3.10, platform=linux, version='3.10.13 (main, Aug 25 2023, 13:20:03) [GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [INFO builtin:65]
108 discover exe for PythonInfo(spec=CPython3.10.13.final.0-64, exe=/home/Temp/v/bin/python3.10, platform=linux, version='3.10.13 (main, Aug 25 2023, 13:20:03) [GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) in /usr [DEBUG py_info:441]
109 filesystem is case-sensitive [DEBUG info:26]
110 discover PATH[0]=/home/.cargo/bin [DEBUG builtin:111]
110 discover PATH[1]=/home/go/bin [DEBUG builtin:111]
110 discover PATH[2]=/usr/local/go/bin [DEBUG builtin:111]
110 discover PATH[3]=/home/linuxbrew/.linuxbrew/opt/fzf/bin [DEBUG builtin:111]
110 discover PATH[4]=/home/.local/bin [DEBUG builtin:111]
110 discover PATH[5]=/home/linuxbrew/.linuxbrew/bin [DEBUG builtin:111]
110 discover PATH[6]=/home/linuxbrew/.linuxbrew/sbin [DEBUG builtin:111]
110 discover PATH[7]=/home/.local/bin [DEBUG builtin:111]
111 discover PATH[8]=/usr/local/sbin [DEBUG builtin:111]
111 discover PATH[9]=/usr/local/bin [DEBUG builtin:111]
111 discover PATH[10]=/usr/sbin [DEBUG builtin:111]
111 discover PATH[11]=/usr/bin [DEBUG builtin:111]
111 Attempting to acquire lock 140469522451472 on /home/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [DEBUG _api:219]
112 Lock 140469522451472 acquired on /home/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [DEBUG _api:222]
112 got python info of %s from (PosixPath('/usr/bin/python3.8'), PosixPath('/home/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.json')) [DEBUG via_disk_folder:131]
112 Attempting to release lock 140469522451472 on /home/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [DEBUG _api:251]
112 Lock 140469522451472 released on /home/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [DEBUG _api:254]
112 proposed PathPythonInfo(spec=CPython3.8.10.final.0-64, exe=/usr/bin/python3.8, platform=linux, version='3.8.10 (default, May 26 2023, 14:05:08) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [INFO builtin:65]
113 accepted PathPythonInfo(spec=CPython3.8.10.final.0-64, exe=/usr/bin/python3.8, platform=linux, version='3.8.10 (default, May 26 2023, 14:05:08) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [DEBUG builtin:67]
154 create virtual environment via CPython3Posix(dest=/home/Temp/aaa, clear=True, no_vcs_ignore=False, global=False) [INFO session:50]
154 delete /home/Temp/aaa [DEBUG creator:156]
184 create folder /home/Temp/aaa/bin [DEBUG _sync:12]
184 create folder /home/Temp/aaa/lib/python3.8/site-packages [DEBUG _sync:12]
184 write /home/Temp/aaa/pyvenv.cfg [DEBUG pyenv_cfg:32]
184 	home = /usr/bin [DEBUG pyenv_cfg:36]
184 	implementation = CPython [DEBUG pyenv_cfg:36]
184 	version_info = 3.8.10.final.0 [DEBUG pyenv_cfg:36]
184 	virtualenv = 20.24.6 [DEBUG pyenv_cfg:36]
184 	include-system-site-packages = false [DEBUG pyenv_cfg:36]
184 	base-prefix = /usr [DEBUG pyenv_cfg:36]
185 	base-exec-prefix = /usr [DEBUG pyenv_cfg:36]
185 	base-executable = /usr/bin/python3.8 [DEBUG pyenv_cfg:36]
185 symlink /usr/bin/python3.8 to /home/Temp/aaa/bin/python [DEBUG _sync:32]
185 create virtualenv import hook file /home/Temp/aaa/lib/python3.8/site-packages/_virtualenv.pth [DEBUG api:91]
185 create /home/Temp/aaa/lib/python3.8/site-packages/_virtualenv.py [DEBUG api:94]
186 ============================== target debug ============================== [DEBUG session:52]
186 debug via /home/Temp/aaa/bin/python /home/Temp/v/lib/python3.10/site-packages/virtualenv/create/debug.py [DEBUG creator:200]
186 {
  "sys": {
    "executable": "/home/Temp/aaa/bin/python",
    "_base_executable": "/home/Temp/aaa/bin/python",
    "prefix": "/home/Temp/aaa",
    "base_prefix": "/usr",
    "real_prefix": null,
    "exec_prefix": "/home/Temp/aaa",
    "base_exec_prefix": "/usr",
    "path": [
      "/usr/lib/python38.zip",
      "/usr/lib/python3.8",
      "/usr/lib/python3.8/lib-dynload",
      "/home/Temp/aaa/lib/python3.8/site-packages"
    ],
    "meta_path": [
      "<class '_virtualenv._Finder'>",
      "<class '_frozen_importlib.BuiltinImporter'>",
      "<class '_frozen_importlib.FrozenImporter'>",
      "<class '_frozen_importlib_external.PathFinder'>"
    ],
    "fs_encoding": "utf-8",
    "io_encoding": "utf-8"
  },
  "version": "3.8.10 (default, May 26 2023, 14:05:08) \n[GCC 9.4.0]",
  "makefile_filename": "/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/Makefile",
  "os": "<module 'os' from '/usr/lib/python3.8/os.py'>",
  "site": "<module 'site' from '/usr/lib/python3.8/site.py'>",
  "datetime": "<module 'datetime' from '/usr/lib/python3.8/datetime.py'>",
  "math": "<module 'math' (built-in)>",
  "json": "<module 'json' from '/usr/lib/python3.8/json/__init__.py'>"
} [DEBUG session:53]
228 add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/.local/share/virtualenv) [INFO session:57]
233 got embed update of distribution %s from ('wheel', PosixPath('/home/.local/share/virtualenv/wheel/3.8/embed/3/wheel.json')) [DEBUG via_disk_folder:131]
233 got embed update of distribution %s from ('setuptools', PosixPath('/home/.local/share/virtualenv/wheel/3.8/embed/3/setuptools.json')) [DEBUG via_disk_folder:131]
238 got embed update of distribution %s from ('pip', PosixPath('/home/.local/share/virtualenv/wheel/3.8/embed/3/pip.json')) [DEBUG via_disk_folder:131]
239 got embed update of distribution %s from ('wheel', PosixPath('/home/.local/share/virtualenv/wheel/3.8/embed/3/wheel.json')) [DEBUG via_disk_folder:131]
241 got embed update of distribution %s from ('pip', PosixPath('/home/.local/share/virtualenv/wheel/3.8/embed/3/pip.json')) [DEBUG via_disk_folder:131]
241 got embed update of distribution %s from ('setuptools', PosixPath('/home/.local/share/virtualenv/wheel/3.8/embed/3/setuptools.json')) [DEBUG via_disk_folder:131]
242 install wheel from wheel /home/Temp/v/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/wheel-0.41.2-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
242 install pip from wheel /home/Temp/v/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/pip-23.3.1-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
243 install setuptools from wheel /home/Temp/v/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/setuptools-68.2.2-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
243 Attempting to acquire lock 140469519966240 on /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-23.3.1-py3-none-any.lock [DEBUG _api:219]
244 Attempting to acquire lock 140469519965520 on /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any.lock [DEBUG _api:219]
244 Lock 140469519966240 acquired on /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-23.3.1-py3-none-any.lock [DEBUG _api:222]
244 Lock 140469519965520 acquired on /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any.lock [DEBUG _api:222]
244 Attempting to release lock 140469519966240 on /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-23.3.1-py3-none-any.lock [DEBUG _api:251]
245 Lock 140469519966240 released on /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-23.3.1-py3-none-any.lock [DEBUG _api:254]
245 Attempting to acquire lock 140469519967920 on /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any.lock [DEBUG _api:219]
245 Attempting to release lock 140469519965520 on /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any.lock [DEBUG _api:251]
245 Lock 140469519965520 released on /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any.lock [DEBUG _api:254]
246 Lock 140469519967920 acquired on /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any.lock [DEBUG _api:222]
246 copy directory /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-23.3.1-py3-none-any/pip to /home/Temp/aaa/lib/python3.8/site-packages/pip [DEBUG _sync:40]
246 Attempting to release lock 140469519967920 on /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any.lock [DEBUG _api:251]
247 Lock 140469519967920 released on /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any.lock [DEBUG _api:254]
247 copy directory /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any/wheel to /home/Temp/aaa/lib/python3.8/site-packages/wheel [DEBUG _sync:40]
248 copy directory /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any/setuptools to /home/Temp/aaa/lib/python3.8/site-packages/setuptools [DEBUG _sync:40]
265 copy directory /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any/wheel-0.41.2.dist-info to /home/Temp/aaa/lib/python3.8/site-packages/wheel-0.41.2.dist-info [DEBUG _sync:40]
269 copy /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any/wheel-0.41.2.virtualenv to /home/Temp/aaa/lib/python3.8/site-packages/wheel-0.41.2.virtualenv [DEBUG _sync:40]
272 generated console scripts wheel3 wheel wheel3.8 wheel-3.8 [DEBUG base:43]
320 copy directory /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any/_distutils_hack to /home/Temp/aaa/lib/python3.8/site-packages/_distutils_hack [DEBUG _sync:40]
321 copy directory /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any/pkg_resources to /home/Temp/aaa/lib/python3.8/site-packages/pkg_resources [DEBUG _sync:40]
335 copy directory /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any/setuptools-68.2.2.dist-info to /home/Temp/aaa/lib/python3.8/site-packages/setuptools-68.2.2.dist-info [DEBUG _sync:40]
338 copy /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any/setuptools-68.2.2.virtualenv to /home/Temp/aaa/lib/python3.8/site-packages/setuptools-68.2.2.virtualenv [DEBUG _sync:40]
338 copy /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any/distutils-precedence.pth to /home/Temp/aaa/lib/python3.8/site-packages/distutils-precedence.pth [DEBUG _sync:40]
340 generated console scripts  [DEBUG base:43]
388 copy /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-23.3.1-py3-none-any/pip-23.3.1.virtualenv to /home/Temp/aaa/lib/python3.8/site-packages/pip-23.3.1.virtualenv [DEBUG _sync:40]
388 copy directory /home/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-23.3.1-py3-none-any/pip-23.3.1.dist-info to /home/Temp/aaa/lib/python3.8/site-packages/pip-23.3.1.dist-info [DEBUG _sync:40]
391 generated console scripts pip-3.8 pip3 pip3.8 pip [DEBUG base:43]
391 add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [INFO session:63]
395 write /home/Temp/aaa/pyvenv.cfg [DEBUG pyenv_cfg:32]
395 	home = /usr/bin [DEBUG pyenv_cfg:36]
395 	implementation = CPython [DEBUG pyenv_cfg:36]
395 	version_info = 3.8.10.final.0 [DEBUG pyenv_cfg:36]
395 	virtualenv = 20.24.6 [DEBUG pyenv_cfg:36]
395 	include-system-site-packages = false [DEBUG pyenv_cfg:36]
395 	base-prefix = /usr [DEBUG pyenv_cfg:36]
395 	base-exec-prefix = /usr [DEBUG pyenv_cfg:36]
395 	base-executable = /usr/bin/python3.8 [DEBUG pyenv_cfg:36]
396 created virtual environment CPython3.8.10.final.0-64 in 296ms
  creator CPython3Posix(dest=/home/Temp/aaa, clear=True, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/.local/share/virtualenv)
    added seed packages: pip==23.3.1, setuptools==68.2.2, wheel==0.41.2
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator [WARNING __main__:19]
```

For `-p` with full path:

```console
102 setup logging to NOTSET [DEBUG report:37]
106 find interpreter for spec PythonSpec(path=/usr/bin/python3.8) [INFO builtin:58]
107 Attempting to acquire lock 140423278693104 on /home/.local/share/virtualenv/py_info/1/8a94588eda9d64d9e9a351ab8144e55b1fabf5113b54e67dd26a8c27df0381b3.lock [DEBUG _api:219]
107 Lock 140423278693104 acquired on /home/.local/share/virtualenv/py_info/1/8a94588eda9d64d9e9a351ab8144e55b1fabf5113b54e67dd26a8c27df0381b3.lock [DEBUG _api:222]
108 got python info of %s from (PosixPath('/usr/bin/python3.10'), PosixPath('/home/.local/share/virtualenv/py_info/1/8a94588eda9d64d9e9a351ab8144e55b1fabf5113b54e67dd26a8c27df0381b3.json')) [DEBUG via_disk_folder:131]
108 Attempting to release lock 140423278693104 on /home/.local/share/virtualenv/py_info/1/8a94588eda9d64d9e9a351ab8144e55b1fabf5113b54e67dd26a8c27df0381b3.lock [DEBUG _api:251]
108 Lock 140423278693104 released on /home/.local/share/virtualenv/py_info/1/8a94588eda9d64d9e9a351ab8144e55b1fabf5113b54e67dd26a8c27df0381b3.lock [DEBUG _api:254]
108 proposed PythonInfo(spec=CPython3.10.13.final.0-64, exe=/usr/bin/python3.10, platform=linux, version='3.10.13 (main, Aug 25 2023, 13:20:03) [GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [INFO builtin:65]
108 accepted PythonInfo(spec=CPython3.10.13.final.0-64, exe=/usr/bin/python3.10, platform=linux, version='3.10.13 (main, Aug 25 2023, 13:20:03) [GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [DEBUG builtin:67]
110 filesystem is case-sensitive [DEBUG info:26]
151 create virtual environment via CPython3Posix(dest=/home/Temp/aaa, clear=True, no_vcs_ignore=False, global=False) [INFO session:50]
151 delete /home/Temp/aaa [DEBUG creator:156]
180 create folder /home/Temp/aaa/bin [DEBUG _sync:12]
181 create folder /home/Temp/aaa/lib/python3.10/site-packages [DEBUG _sync:12]
181 write /home/Temp/aaa/pyvenv.cfg [DEBUG pyenv_cfg:32]
181 	home = /usr/bin [DEBUG pyenv_cfg:36]
181 	implementation = CPython [DEBUG pyenv_cfg:36]
181 	version_info = 3.10.13.final.0 [DEBUG pyenv_cfg:36]
181 	virtualenv = 20.24.6 [DEBUG pyenv_cfg:36]
181 	include-system-site-packages = false [DEBUG pyenv_cfg:36]
181 	base-prefix = /usr [DEBUG pyenv_cfg:36]
181 	base-exec-prefix = /usr [DEBUG pyenv_cfg:36]
181 	base-executable = /usr/bin/python3.10 [DEBUG pyenv_cfg:36]
181 symlink /usr/bin/python3.10 to /home/Temp/aaa/bin/python [DEBUG _sync:32]
182 create virtualenv import hook file /home/Temp/aaa/lib/python3.10/site-packages/_virtualenv.pth [DEBUG api:91]
182 create /home/Temp/aaa/lib/python3.10/site-packages/_virtualenv.py [DEBUG api:94]
182 ============================== target debug ============================== [DEBUG session:52]
183 debug via /home/Temp/aaa/bin/python /home/Temp/v/lib/python3.10/site-packages/virtualenv/create/debug.py [DEBUG creator:200]
182 {
  "sys": {
    "executable": "/home/Temp/aaa/bin/python",
    "_base_executable": "/home/Temp/aaa/bin/python",
    "prefix": "/home/Temp/aaa",
    "base_prefix": "/usr",
    "real_prefix": null,
    "exec_prefix": "/home/Temp/aaa",
    "base_exec_prefix": "/usr",
    "path": [
      "/usr/lib/python310.zip",
      "/usr/lib/python3.10",
      "/usr/lib/python3.10/lib-dynload",
      "/home/Temp/aaa/lib/python3.10/site-packages"
    ],
    "meta_path": [
      "<class '_virtualenv._Finder'>",
      "<class '_frozen_importlib.BuiltinImporter'>",
      "<class '_frozen_importlib.FrozenImporter'>",
      "<class '_frozen_importlib_external.PathFinder'>"
    ],
    "fs_encoding": "utf-8",
    "io_encoding": "utf-8"
  },
  "version": "3.10.13 (main, Aug 25 2023, 13:20:03) [GCC 9.4.0]",
  "makefile_filename": "/usr/lib/python3.10/config-3.10-x86_64-linux-gnu/Makefile",
  "os": "<module 'os' from '/usr/lib/python3.10/os.py'>",
  "site": "<module 'site' from '/usr/lib/python3.10/site.py'>",
  "datetime": "<module 'datetime' from '/usr/lib/python3.10/datetime.py'>",
  "math": "<module 'math' (built-in)>",
  "json": "<module 'json' from '/usr/lib/python3.10/json/__init__.py'>"
} [DEBUG session:53]
226 add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/.local/share/virtualenv) [INFO session:57]
231 got embed update of distribution %s from ('wheel', PosixPath('/home/.local/share/virtualenv/wheel/3.10/embed/3/wheel.json')) [DEBUG via_disk_folder:131]
236 got embed update of distribution %s from ('pip', PosixPath('/home/.local/share/virtualenv/wheel/3.10/embed/3/pip.json')) [DEBUG via_disk_folder:131]
237 got embed update of distribution %s from ('setuptools', PosixPath('/home/.local/share/virtualenv/wheel/3.10/embed/3/setuptools.json')) [DEBUG via_disk_folder:131]
239 got embed update of distribution %s from ('pip', PosixPath('/home/.local/share/virtualenv/wheel/3.10/embed/3/pip.json')) [DEBUG via_disk_folder:131]
240 got embed update of distribution %s from ('setuptools', PosixPath('/home/.local/share/virtualenv/wheel/3.10/embed/3/setuptools.json')) [DEBUG via_disk_folder:131]
240 got embed update of distribution %s from ('wheel', PosixPath('/home/.local/share/virtualenv/wheel/3.10/embed/3/wheel.json')) [DEBUG via_disk_folder:131]
241 install pip from wheel /home/Temp/v/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/pip-23.3.1-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
241 install setuptools from wheel /home/Temp/v/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/setuptools-68.2.2-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
242 install wheel from wheel /home/Temp/v/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/wheel-0.41.2-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
243 Attempting to acquire lock 140423276212816 on /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/pip-23.3.1-py3-none-any.lock [DEBUG _api:219]
243 Attempting to acquire lock 140423276213152 on /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any.lock [DEBUG _api:219]
244 Attempting to acquire lock 140423276212720 on /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any.lock [DEBUG _api:219]
244 Lock 140423276213152 acquired on /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any.lock [DEBUG _api:222]
244 Lock 140423276212816 acquired on /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/pip-23.3.1-py3-none-any.lock [DEBUG _api:222]
244 Attempting to release lock 140423276213152 on /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any.lock [DEBUG _api:251]
244 Lock 140423276213152 released on /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any.lock [DEBUG _api:254]
245 Attempting to release lock 140423276212816 on /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/pip-23.3.1-py3-none-any.lock [DEBUG _api:251]
245 Lock 140423276212720 acquired on /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any.lock [DEBUG _api:222]
245 Lock 140423276212816 released on /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/pip-23.3.1-py3-none-any.lock [DEBUG _api:254]
245 Attempting to release lock 140423276212720 on /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any.lock [DEBUG _api:251]
246 Lock 140423276212720 released on /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any.lock [DEBUG _api:254]
246 copy directory /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any/wheel to /home/Temp/aaa/lib/python3.10/site-packages/wheel [DEBUG _sync:40]
247 copy directory /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/pip-23.3.1-py3-none-any/pip to /home/Temp/aaa/lib/python3.10/site-packages/pip [DEBUG _sync:40]
248 copy directory /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any/setuptools to /home/Temp/aaa/lib/python3.10/site-packages/setuptools [DEBUG _sync:40]
267 copy directory /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any/wheel-0.41.2.dist-info to /home/Temp/aaa/lib/python3.10/site-packages/wheel-0.41.2.dist-info [DEBUG _sync:40]
272 copy /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/wheel-0.41.2-py3-none-any/wheel-0.41.2.virtualenv to /home/Temp/aaa/lib/python3.10/site-packages/wheel-0.41.2.virtualenv [DEBUG _sync:40]
275 generated console scripts wheel3.10 wheel3 wheel wheel-3.10 [DEBUG base:43]
335 copy directory /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any/_distutils_hack to /home/Temp/aaa/lib/python3.10/site-packages/_distutils_hack [DEBUG _sync:40]
336 copy directory /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any/pkg_resources to /home/Temp/aaa/lib/python3.10/site-packages/pkg_resources [DEBUG _sync:40]
358 copy directory /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any/setuptools-68.2.2.dist-info to /home/Temp/aaa/lib/python3.10/site-packages/setuptools-68.2.2.dist-info [DEBUG _sync:40]
361 copy /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any/setuptools-68.2.2.virtualenv to /home/Temp/aaa/lib/python3.10/site-packages/setuptools-68.2.2.virtualenv [DEBUG _sync:40]
362 copy /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/setuptools-68.2.2-py3-none-any/distutils-precedence.pth to /home/Temp/aaa/lib/python3.10/site-packages/distutils-precedence.pth [DEBUG _sync:40]
363 generated console scripts  [DEBUG base:43]
407 copy /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/pip-23.3.1-py3-none-any/pip-23.3.1.virtualenv to /home/Temp/aaa/lib/python3.10/site-packages/pip-23.3.1.virtualenv [DEBUG _sync:40]
407 copy directory /home/.local/share/virtualenv/wheel/3.10/image/1/CopyPipInstall/pip-23.3.1-py3-none-any/pip-23.3.1.dist-info to /home/Temp/aaa/lib/python3.10/site-packages/pip-23.3.1.dist-info [DEBUG _sync:40]
410 generated console scripts pip3.10 pip-3.10 pip pip3 [DEBUG base:43]
410 add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [INFO session:63]
414 write /home/Temp/aaa/pyvenv.cfg [DEBUG pyenv_cfg:32]
414 	home = /usr/bin [DEBUG pyenv_cfg:36]
414 	implementation = CPython [DEBUG pyenv_cfg:36]
414 	version_info = 3.10.13.final.0 [DEBUG pyenv_cfg:36]
414 	virtualenv = 20.24.6 [DEBUG pyenv_cfg:36]
414 	include-system-site-packages = false [DEBUG pyenv_cfg:36]
415 	base-prefix = /usr [DEBUG pyenv_cfg:36]
415 	base-exec-prefix = /usr [DEBUG pyenv_cfg:36]
415 	base-executable = /usr/bin/python3.10 [DEBUG pyenv_cfg:36]
415 created virtual environment CPython3.10.13.final.0-64 in 315ms
  creator CPython3Posix(dest=/home/Temp/aaa, clear=True, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/.local/share/virtualenv)
    added seed packages: pip==23.3.1, setuptools==68.2.2, wheel==0.41.2
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator [WARNING __main__:19]
```
Document interaction of --python, --try-first-with, and $VIRTUALENV_PYTHON and fix inconsistencies
**Issue**

Like @kapec94 in #2659, I came across confusing interaction between these parameters in Poetry (see [my comment on 9278](https://github.com/python-poetry/poetry/issues/9278#issuecomment-2108666111)). I think, now, that part of the problem I was seeing then was [Debian's python3-virtualenv](https://packages.debian.org/bookworm/python3-virtualenv), but I think I've compiled a list of problems using [this demonstration script](https://gist.github.com/hexmode/01c664dc51bbb5dd7bbbe10f2e0c3279) ([output](https://gist.github.com/hexmode/ba06b737b38a5e23def37a67cec0a819)).

Interesting points:

| ENV |                                  python flag | try-first-with                                | activated |    | notes                                                             |
|-----|----------------------------------------------|-----------------------------------------------|-----------|----|-------------------------------------------------------------------|
|     |                                              | ~/.asdf/installs/python/3.9.19/bin/python3.9  |    3.9.19 | ✅ | try-first-with is used and path is ignored                        |
|     |                                          3.9 | ~/.asdf/installs/python/3.9.19/bin/python3.9  |    3.9.19 | ✅ | try-first-with provides matching python                           |
|     |                                          3.9 | ~/.asdf/installs/python/3.11.9/bin/python3.11 |     3.9.2 | ✅ | try-first-with is ignored b/c wrong version, found python in path |
|     | ~/.asdf/installs/python/3.11.9/bin/python3.11| ~/.asdf/installs/python/3.9.19/bin/python3.9  |    3.9.19 | ❌ | python flag should be used (See [this comment on #2659](https://github.com/pypa/virtualenv/issues/2659#issuecomment-1779555809)) |
| 3.9 |                                         3.11 | ~/.asdf/installs/python/3.11.9/bin/python3.11 |    3.9.2  | ❌ | python flag should override env (See [this comment on #2285](https://github.com/pypa/virtualenv/issues/2285#issuecomment-1013348779)) |

Creating a new issue to focus the work.

Discussion hints:

Solution patch:
diff --git a/docs/changelog/2659.bugfix.rst b/docs/changelog/2659.bugfix.rst
new file mode 100644
index 00000000..d6d6c722
--- /dev/null
+++ b/docs/changelog/2659.bugfix.rst
@@ -0,0 +1,2 @@
+Stop `--try-first-with` overriding absolute `--python` paths.
+Contributed by :user:`esafak`.
diff --git a/docs/cli_interface.rst b/docs/cli_interface.rst
index 1bbbe234..27ea231e 100644
--- a/docs/cli_interface.rst
+++ b/docs/cli_interface.rst
@@ -24,6 +24,51 @@ The options that can be passed to virtualenv, along with their default values an
    :module: virtualenv.run
    :func: build_parser_only
 
+Discovery options
+~~~~~~~~~~~~~~~~~
+
+Understanding Interpreter Discovery: ``--python`` vs. ``--try-first-with``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+You can control which Python interpreter ``virtualenv`` selects using the ``--python`` and ``--try-first-with`` flags.
+To avoid confusion, it's best to think of them as the "rule" and the "hint".
+
+**``--python <spec>``: The Rule**
+
+This flag sets the mandatory requirements for the interpreter. The ``<spec>`` can be:
+
+- **A version string** (e.g., ``python3.8``, ``pypy3``). ``virtualenv`` will search for any interpreter that matches this version.
+- **An absolute path** (e.g., ``/usr/bin/python3.8``). This is a *strict* requirement. Only the interpreter at this exact path will be used. If it does not exist or is not a valid interpreter, creation will fail.
+
+**``--try-first-with <path>``: The Hint**
+
+This flag provides a path to a Python executable to check *before* ``virtualenv`` performs its standard search. This can speed up discovery or help select a specific interpreter when multiple versions exist on your system.
+
+**How They Work Together**
+
+``virtualenv`` will only use an interpreter from ``--try-first-with`` if it **satisfies the rule** from the ``--python`` flag. The ``--python`` rule always wins.
+
+**Examples:**
+
+1. **Hint does not match the rule:**
+
+   .. code-block:: bash
+
+      virtualenv --python python3.8 --try-first-with /usr/bin/python3.10 my-env
+
+   - **Result:** ``virtualenv`` first inspects ``/usr/bin/python3.10``. It sees this does not match the ``python3.8`` rule and **rejects it**. It then proceeds with its normal search to find a ``python3.8`` interpreter elsewhere.
+
+2. **Hint does not match a strict path rule:**
+
+   .. code-block:: bash
+
+      virtualenv --python /usr/bin/python3.8 --try-first-with /usr/bin/python3.10 my-env
+
+   - **Result:** The rule is strictly ``/usr/bin/python3.8``. ``virtualenv`` checks the ``/usr/bin/python3.10`` hint, sees the path doesn't match, and **rejects it**. It then moves on to test ``/usr/bin/python3.8`` and successfully creates the environment.
+
+This approach ensures that the behavior is predictable and that ``--python`` remains the definitive source of truth for the user's intent.
+
+
 Defaults
 ~~~~~~~~
 
diff --git a/src/virtualenv/discovery/builtin.py b/src/virtualenv/discovery/builtin.py
index d7c647c9..841d36b1 100644
--- a/src/virtualenv/discovery/builtin.py
+++ b/src/virtualenv/discovery/builtin.py
@@ -96,9 +96,23 @@ def propose_interpreters(  # noqa: C901, PLR0912, PLR0915
     app_data: AppData | None = None,
     env: Mapping[str, str] | None = None,
 ) -> Generator[tuple[PythonInfo, bool], None, None]:
-    # 0. try with first
+    # 0. if it's a path and exists, and is absolute path, this is the only option we consider
     env = os.environ if env is None else env
     tested_exes: set[str] = set()
+    if spec.is_abs:
+        try:
+            os.lstat(spec.path)  # Windows Store Python does not work with os.path.exists, but does for os.lstat
+        except OSError:
+            pass
+        else:
+            exe_raw = os.path.abspath(spec.path)
+            exe_id = fs_path_id(exe_raw)
+            if exe_id not in tested_exes:
+                tested_exes.add(exe_id)
+                yield PythonInfo.from_exe(exe_raw, app_data, env=env), True
+        return
+
+    # 1. try with first
     for py_exe in try_first_with:
         path = os.path.abspath(py_exe)
         try:


Test patch:
diff --git a/tests/unit/discovery/test_discovery.py b/tests/unit/discovery/test_discovery.py
index 26e8d1e0..79f83d88 100644
--- a/tests/unit/discovery/test_discovery.py
+++ b/tests/unit/discovery/test_discovery.py
@@ -200,6 +200,32 @@ def test_returns_second_python_specified_when_more_than_one_is_specified_and_env
     assert result == mocker.sentinel.python_from_cli
 
 
+def test_discovery_absolute_path_with_try_first(tmp_path, session_app_data):
+    good_env = tmp_path / "good"
+    bad_env = tmp_path / "bad"
+
+    # Create two real virtual environments
+    subprocess.check_call([sys.executable, "-m", "virtualenv", str(good_env)])
+    subprocess.check_call([sys.executable, "-m", "virtualenv", str(bad_env)])
+
+    # On Windows, the executable is in Scripts/python.exe
+    scripts_dir = "Scripts" if IS_WIN else "bin"
+    exe_name = "python.exe" if IS_WIN else "python"
+    good_exe = good_env / scripts_dir / exe_name
+    bad_exe = bad_env / scripts_dir / exe_name
+
+    # The spec is an absolute path, this should be a hard requirement.
+    # The --try-first-with option should be rejected as it does not match the spec.
+    interpreter = get_interpreter(
+        str(good_exe),
+        try_first_with=[str(bad_exe)],
+        app_data=session_app_data,
+    )
+
+    assert interpreter is not None
+    assert Path(interpreter.executable) == good_exe
+
+
 def test_discovery_via_path_with_file(tmp_path, monkeypatch):
     a_file = tmp_path / "a_file"
     a_file.touch()