install-poetry: Windows Latest on Python 3.8 Constantly Fails

For some reason, Windows-2022 is now failing for me on Python 3.8 only:

Run snok/install-poetry@v[1](https://github.com/adam-grant-hendry/qtpygraph/actions/runs/3202205327/jobs/5230946943#step:6:1).3.2
Run $GITHUB_ACTION_PATH/main.sh

Setting Poetry installation path as C:/Users/runneradmin/AppData/Roaming/Python/Scripts

Installing Poetry 👷

Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

C:\Users\runneradmin\AppData\Roaming\Python\Scripts\bin

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.2.1)
Installing Poetry (1.2.1): Creating environment
Installing Poetry (1.2.1): An error occurred. Removing partial environment.
Traceback (most recent call last):
  File "C:/Users/RUNNER~1/AppData/Local/Temp/tmp.0IGyZ1qQC7", line 9[40](https://github.com/adam-grant-hendry/qtpygraph/actions/runs/3202205327/jobs/5230946943#step:6:42), in <module>
    sys.exit(main())
  File "C:/Users/RUNNER~1/AppData/Local/Temp/tmp.0IGyZ1qQC7", line 919, in main
    return installer.run()
  File "C:/Users/RUNNER~1/AppData/Local/Temp/tmp.0IGyZ1qQC7", line 550, in run
    self.install(version)
  File "C:/Users/RUNNER~1/AppData/Local/Temp/tmp.0IGyZ1qQC7", line 571, in install
    with self.make_env(version) as env:
  File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "C:/Users/RUNNER~1/AppData/Local/Temp/tmp.0IGyZ1qQC7", line 643, in make_env
    raise e
  File "C:/Users/RUNNER~1/AppData/Local/Temp/tmp.0IGyZ1qQC7", line 629, in make_env
    yield VirtualEnvironment.make(env_path)
  File "C:/Users/RUNNER~1/AppData/Local/Temp/tmp.0IGyZ1qQC7", line 319, in make
    builder.create(target)
  File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\venv\__init__.py", line 68, in create
    self._setup_pip(context)
  File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\venv\__init__.py", line 289, in _setup_pip
    subprocess.check_output(cmd, stderr=subprocess.STDOUT)
  File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\subprocess.py", line [41](https://github.com/adam-grant-hendry/qtpygraph/actions/runs/3202205327/jobs/5230946943#step:6:43)5, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\subprocess.py", line [49](https://github.com/adam-grant-hendry/qtpygraph/actions/runs/3202205327/jobs/5230946943#step:6:51)3, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\subprocess.py", line 8[58](https://github.com/adam-grant-hendry/qtpygraph/actions/runs/3202205327/jobs/5230946943#step:6:60), in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\hostedtoolcache\windows\Python\3.8.10\x[64](https://github.com/adam-grant-hendry/qtpygraph/actions/runs/3202205327/jobs/5230946943#step:6:66)\lib\subprocess.py", line 1311, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
Error: Process completed with exit code 1.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 28 (10 by maintainers)

Commits related to this issue

Most upvoted comments

@miigotu: It worked on the windows-latest runner with the action version 1.3.1, but not with the version 1.3.2, using poetry version 1.1.14 in both scenarios.

EDIT: Idem with poetry version 1.2.1 (therefore the problem seems related to the latest action tag: 1.3.2).

In the latest push to #95 I’ve added the --ssl-no-revoke command to main.sh.

@adam-grant-hendry, would you mind testing with @94 instead of v1.3.1 to see if that works for you?

Having had time to look at https://github.com/python-poetry/install.python-poetry.org/issues/46 @miigotu, I think they’re saying git bash on windows runners are affected, so I think this is an upstream bug. The script target for this github action was changed a while back, but I hadn’t released a new version until v1.3.2, so that’s why this is happening.

Perhaps we should do a simple

if windows on python 3.8 or less:
    install using old script
else:
    install using new script

What do you think?

So far I’ve tried:

  • Setting Python to 3.8.10 which is the version specifically used in the failing run above
  • Added SHELLOPTS to env
  • Tried setting windows-2022 instead of windows-latest
  • Switched to creating venvs in the basic test case

but so far nothing reproduces

We mostly just quoted env vars in the latest release. I’ll add a test case for Windows later to see if I can reproduce.

Would you be able to share the relevant parts of your workflow to make that easier?

@sondrelg How strange. Yes! That completely fixed it!

…What’s happened from v1.3.1 to v1.3.2?