pypa / virtualenv

Virtual Python Environment builder
https://virtualenv.pypa.io
MIT License
4.8k stars 1.03k forks source link

`try-first-with` behaves differently for `--python` full paths and version specs #2659

Open kapec94 opened 10 months ago

kapec94 commented 10 months ago

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:

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:

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:

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]
gaborbernat commented 10 months ago

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

This is a bug, PR to fix it welcome.

kapec94 commented 10 months ago

Thanks. As it caused me to lose a few days of work (tox and poetry are affected, if there’s an ini file with the setting), I’ll try to tackle it over the next weeks.

Bernát Gábor @.***> schrieb am Mi. 25. Okt. 2023 um 17:38:

Assigned #2659 https://github.com/pypa/virtualenv/issues/2659 to @kapec94 https://github.com/kapec94.

— Reply to this email directly, view it on GitHub https://github.com/pypa/virtualenv/issues/2659#event-10769295243, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKOE4NWQHRHB7K3RF5JLYTYBEW77AVCNFSM6AAAAAA6PHH4FWVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJQG43DSMRZGUZDIMY . You are receiving this because you were assigned.Message ID: @.***>

jjtowers commented 4 months ago

+1