Skip to content

MSYS2 (MinGW32/64 or UCRT64) fails on Create virtual environment .venv #24792

@truongan012

Description

@truongan012

#@@type: Bug

Reproduced:

  1. Create python virtual environment
  2. Select python from msys2
  3. Wait for creation and error popped up.

Extension version: 2024.22.2
Visual Studio Code 1.96.4
OS version: Windows 11 Pro 24H2 26100.2894

Untitled.video.-.Made.with.Clipchamp.mp4

Logs

2025-02-06 22:09:26.846 [info] Selected workspace c:\Users\ltan\Workspaces\PythonServerTest for creating virtual environment.
2025-02-06 22:09:26.848 [info] Native locator: Refresh started
2025-02-06 22:09:26.958 [info] Native locator: Refresh finished in 111 ms
2025-02-06 22:09:29.272 [info] Selected interpreter C:\msys64\ucrt64\bin\python3.12.exe for creating virtual environment.
2025-02-06 22:09:29.338 [info] Running Env creation script:  [
  'C:\\msys64\\ucrt64\\bin\\python3.12.exe',
  'c:\\Users\\ltan\\.vscode\\extensions\\ms-python.python-2024.22.2-win32-x64\\python_files\\create_venv.py',
  '--git-ignore'
]
2025-02-06 22:09:29.338 [info] > C:\msys64\ucrt64\bin\python3.12.exe ~\.vscode\extensions\ms-python.python-2024.22.2-win32-x64\python_files\create_venv.py --git-ignore
2025-02-06 22:09:29.339 [info] cwd: .
2025-02-06 22:09:29.571 [info] Running: C:\msys64\ucrt64\bin\python3.12.exe -m venv .venv
2025-02-06 22:09:34.373 [info] CREATED_VENV:C:\Users\ltan\Workspaces\PythonServerTest\.venv\Scripts\python.exe
2025-02-06 22:09:34.373 [info] Creating: C:\Users\ltan\Workspaces\PythonServerTest\.venv\.gitignore
2025-02-06 22:09:34.374 [info] CREATE_VENV.UPGRADING_PIP
Running: C:\Users\ltan\Workspaces\PythonServerTest\.venv\Scripts\python.exe -m pip install --upgrade pip
2025-02-06 22:09:34.375 [info] Traceback (most recent call last):
  File "c:\Users\ltan\.vscode\extensions\ms-python.python-2024.22.2-win32-x64\python_files\create_venv.py", line 262, in <module>
2025-02-06 22:09:34.375 [info]     main(sys.argv[1:])
2025-02-06 22:09:34.375 [info]   File "c:\Users\ltan\.vscode\extensions\ms-python.python-2024.22.2-win32-x64\python_files\create_venv.py", line 245, in main
2025-02-06 22:09:34.375 [info]     upgrade_pip(venv_path)
  File "c:\Users\ltan\.vscode\extensions\ms-python.python-2024.22.2-win32-x64\python_files\create_venv.py", line 134, in upgrade_pip
2025-02-06 22:09:34.375 [info]     run_process(
  File "c:\Users\ltan\.vscode\extensions\ms-python.python-2024.22.2-win32-x64\python_files\create_venv.py", line 96, in run_process
2025-02-06 22:09:34.376 [info]     subprocess.run(args, cwd=os.getcwd(), check=True)  # noqa: PTH109
2025-02-06 22:09:34.376 [info]     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-06 22:09:34.376 [info] ^^^
  File "C:\msys64\ucrt64\lib\python3.12\subprocess.py", line 548, in run
2025-02-06 22:09:34.376 [info]     with Popen(*popenargs, **kwargs) as process:
2025-02-06 22:09:34.376 [info]          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\msys64\ucrt64\lib\python3.12\subprocess.py", line 1026, in __init__
2025-02-06 22:09:34.377 [info]     self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\msys64\ucrt64\lib\python3.12\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
2025-02-06 22:09:34.411 [error] Error while running venv creation script:  undefined
2025-02-06 22:09:34.412 [error] Failed to create virtual environment with exitCode: 1
2025-02-06 22:18:35.461 [error] Invalid version for c:\Users\ltan\Workspaces\PythonServerTest\.venv\Scripts\python.exe: {"name":".venv","location":"c:\\Users\\ltan\\Workspaces\\PythonServerTest\\.venv\\Scripts\\python.exe","kind":"virt-venv","id":"c:\\Users\\ltan\\Workspaces\\PythonServerTest\\.venv\\Scripts\\python.exe","executable":{"filename":"c:\\Users\\ltan\\Workspaces\\PythonServerTest\\.venv\\Scripts\\python.exe","sysPrefix":"C:\\Users\\ltan\\Workspaces\\PythonServerTest\\.venv","ctime":-1,"mtime":-1},"version":{"sysVersion":null,"major":-1,"minor":-1,"micro":-1},"arch":1,"distro":{"org":""},"source":[],"detailedDisplayName":"Python","display":"Python","type":"Virtual"}
2025-02-06 22:18:47.303 [error] Invalid version for c:\Users\ltan\Workspaces\PythonServerTest\.venv\Scripts\python.exe: {"name":".venv","location":"c:\\Users\\ltan\\Workspaces\\PythonServerTest\\.venv\\Scripts\\python.exe","kind":"virt-venv","id":"c:\\Users\\ltan\\Workspaces\\PythonServerTest\\.venv\\Scripts\\python.exe","executable":{"filename":"c:\\Users\\ltan\\Workspaces\\PythonServerTest\\.venv\\Scripts\\python.exe","sysPrefix":"C:\\Users\\ltan\\Workspaces\\PythonServerTest\\.venv","ctime":-1,"mtime":-1},"version":{"sysVersion":null,"major":-1,"minor":-1,"micro":-1},"arch":1,"distro":{"org":""},"source":[],"detailedDisplayName":"Python","display":"Python","type":"Virtual"}
2025-02-06 22:19:08.629 [error] Invalid version for c:\Users\ltan\Workspaces\PythonServerTest\.venv\Scripts\python.exe: {"name":".venv","location":"c:\\Users\\ltan\\Workspaces\\PythonServerTest\\.venv\\Scripts\\python.exe","kind":"virt-venv","id":"c:\\Users\\ltan\\Workspaces\\PythonServerTest\\.venv\\Scripts\\python.exe","executable":{"filename":"c:\\Users\\ltan\\Workspaces\\PythonServerTest\\.venv\\Scripts\\python.exe","sysPrefix":"C:\\Users\\ltan\\Workspaces\\PythonServerTest\\.venv","ctime":-1,"mtime":-1},"version":{"sysVersion":null,"major":-1,"minor":-1,"micro":-1},"arch":1,"distro":{"org":""},"source":[],"detailedDisplayName":"Python","display":"Python","type":"Virtual"}

Please help to check it! Thanks!

Metadata

Metadata

Assignees

Labels

area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions