nat-n / poethepoet

A task runner that works well with poetry.
https://poethepoet.natn.io/
MIT License
1.39k stars 56 forks source link

Missing POSIX executable on Win10 #195

Closed LukasHebing closed 7 months ago

LukasHebing commented 7 months ago

I am using poethepoet inside a venv from poetry on Windows 10. After I activated the virtual environment with poetry shell, I can use poe. However, any command with poe returns the error:

Error: Couldn't locate interpreter executable for ('posix',) to run shell task. Some dependencies may be missing from your system.

Is this a problem for windows systems? Can poe be used on Windows without WSL?

nat-n commented 7 months ago

Hi @LukasHebing,

TLDR: prefer cmd tasks to shell tasks for portability.

Poethepoet works fine on windows with or without WSL, with one caveat explained below.

It looks like your task is failing because it's defined as a shell task, and post can't find a POSIX shell on your system. On windows this can work with WSL, or Git Bash, or anything else that puts a bash executable or similar on your path. You can also configure the shell interpreter to be pwsh or something else.

However shell tasks are only necessary if you want to use shell features or complex scripts (like control flow, inline variables or background tasks). If you're just running commands or python functions you can do with with cmd tasks or script tasks respectively which will run the task as a subprocess without involving a shell.

LukasHebing commented 7 months ago

Adding the interpreter powershell to the task fixed that. Thank you!