Maria
02/25/2021, 11:59 PMfrom prefect import Flow
from prefect.tasks.shell import ShellTask
task = ShellTask(helper_script="cd ~")
with Flow("My Flow") as f:
contents = task(command='ls')
out = f.run()
[2021-02-26 10:32:28+1100] INFO - prefect.FlowRunner | Beginning Flow run for 'My Flow'
[2021-02-26 10:32:28+1100] INFO - prefect.TaskRunner | Task 'ShellTask': Starting task run...
[2021-02-26 10:32:28+1100] ERROR - prefect.TaskRunner | Unexpected error: FileNotFoundError(2, 'The system cannot find the file specified', None, 2, None)
Traceback (most recent call last):
.....
....
python\python38-32\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
I do have bash installed, also specifying path doesn't help task = ShellTask(shell="C:\Windows\System32\bash.exe", helper_script="cd ~")
Zanie
Zanie
subprocess.Popen([shell])
-- if you open an interactive python session and do
import subprocess
process = subprocess.Popen(["C:\Windows\System32\bash.exe"])
Zanie
❯ python
Python 3.8.6 (default, Feb 19 2021, 10:36:24)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.Popen(["bash"])
<subprocess.Popen object at 0x10115ea00>
>>>
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit <https://support.apple.com/kb/HT208050>.
bash-3.2$
Maria
02/26/2021, 1:37 AMMaria
02/26/2021, 1:40 AM>>> subprocess.Popen("C:\Windows\System32\bash.exe", shell=True)
<subprocess.Popen object at 0x039AE718>
>>> The filename, directory name, or volume label syntax is incorrect.
Maria
02/26/2021, 1:46 AMZanie
Maria
02/26/2021, 1:47 AMtheo geer
04/13/2021, 3:35 PMZanie
Zanie
Marvin
04/13/2021, 3:38 PMtheo geer
04/13/2021, 3:59 PMZanie
Zanie
Zanie