-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python3 cannot be used to create venvs on recent Windows images #2690
Comments
Hi @ptheywood , looks like venv is not working with symlinks by default, you can try to use
https://github.com/vsafonkin/cmake-ctest-pytest/runs/1885272400?check_suite_focus=true |
@vsafonkin I confirm |
The documentation for If having I can't reproduce this on a local windows machine both Edit: This would suggest hard links are broken too, https://github.com/Robadob/cmake-ctest-pytest/runs/1886181603?check_suite_focus=true
Edit: Even a copy fails the same as a symlink, this is very unusual. https://github.com/Robadob/cmake-ctest-pytest/runs/1886195635 Thanks |
@Robadob , thank you for your help, looks like
UPD: but I can't understand why it doesn't work with copy of executable file. |
Stack overflow suggests it's a common problem when you rename python.exe (when python 2 is also on the path?). Edit: Disabling windows defender/Windows defender controlled file access doesn't appear to help. And python2 isn't on the path, so that seems unrelated. |
Yes using
We've got a workaround for CMake finding the symlinked executable, by telling it to use the relevant |
@ptheywood does the workarounds work for your builds? |
@dsame Refer to his previous comment if you haven't already noticed it. This is the commit he made to address it: FLAMEGPU/FLAMEGPU2@0b4f2f1 |
Hi @ptheywood, unfortunately, we didn't find any ways to resolve this issue. You can use either |
@vsafonkin, it would be really helpful if this made it into the documentation of both, the Windows image and the |
It does look like this is fixed in cpython |
@Robadob @vsafonkin Tried to run: virtualenv ..venv -p python, but got Fatal error in launcher: Unable to create process using '"C:\Users\Name\AppData\Local\Programs\Python\Python311\python.exe" "C:\Users\name\AppData\Local\Programs\Python\Python311\Scripts\virtualenv.exe" ..venv -p python': The system cannot find the file specified. |
Description
The
python3
executable errors when creating virtual environments, unlike thepython
executable on windows images.python3 -m venv env
leads to the following errorError: [WinError 2] The system cannot find the file specified
.python -m venv env
successfully creates the venv.This is only an issue since the
20210202.1
version of thewindows-2019
environment which introduced thepython3
symlink (#2461, actions/python-versions#78).Here is an action run which illustrates this problem.
https://github.com/ptheywood/cmake-ctest-pytest/runs/1882133904?check_suite_focus=true
We only encountered this issue as we have a cmake process that creates a virtual environment to install a python package into for testing. CMakes module to find python prefers the executable containing the version name.
Area for Triage:
Python
Question, Bug, or Feature?:
Bug
Virtual environments affected
Image version
20210202.1
Expected behavior
Virtual environment successfully created.
Actual behavior
Error: [WinError 2] The system cannot find the file specified
Repro steps
python -m venv py-env
- workspython3 -m venv py3-env
- errorsExample: https://github.com/ptheywood/cmake-ctest-pytest/runs/1882133904?check_suite_focus=true
The text was updated successfully, but these errors were encountered: