I have replaced "Docker Desktop for Windows" with Podman and Podman Desktop. I also installed podman-compose. podman and podman-compose run fine on the WSL command line (I installed an Ubuntu distro).
I can also execute "podman" on the Windows command line (in both, cmd and PowerShell). However, "podman-compose" is not recognized as a command.
What is required to also be able to execute "podman-compose" on the Windows command line? I googled around but all instructions I found seem to assume that one executes that in a shell in WSL.
Is this possible at all? I can imagine that passing the current Windows path to the shell in WSL and other details may be a bit of a problem…
Addition – response to @mre (below):
Thanks for the instructions. I executed them. The first three lines went OK, but the last one yields:
(venv-podman) C:Usersmmo>podman-compose --version
podman-compose version: 1.0.6
['podman', '--version', '']
Traceback (most recent call last):
File "C:Python310librunpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:Python310librunpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:Usersmmovenv-podmanScriptspodman-compose.exe__main__.py", line 7, in <module>
File "C:Usersmmovenv-podmanlibsite-packagespodman_compose.py", line 2941, in main
podman_compose.run()
File "C:Usersmmovenv-podmanlibsite-packagespodman_compose.py", line 1406, in run
self.podman.output(["--version"], "", []).decode("utf-8").strip()
File "C:Usersmmovenv-podmanlibsite-packagespodman_compose.py", line 1098, in output
return subprocess.check_output(cmd_ls)
File "C:Python310libsubprocess.py", line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:Python310libsubprocess.py", line 501, in run
with Popen(*popenargs, **kwargs) as process:
File "C:Python310libsubprocess.py", line 969, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:Python310libsubprocess.py", line 1438, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
(venv-podman) C:Usersmmo>
Any idea?
2
Answers
Turned out that the issue running python scripts (and podman-compose apparently is just a python script) was a brain-damaged feature in Windows, namely two "Windows execution aliases" that - for whatever reason - were defined on my system. When calling "python" on the command line this opened the Windows Store offering to download and install python instead of actually starting Python (which I had already installed via the normal installer).
It puzzled me enormously why entering "python" would bring up the windows store even though the Python install directory was on the path. I finally found an explanation for that "phenomenon" and a solution how to remove that garbage here: CMD opens Windows Store when I type 'python' Removing/disabling this "alias" also fixed the issue with podman-compose...
Basically it’s the same process as installing "podman-compose" into WSL (or any other Linux distro):
Install Python for Windows: https://www.python.org/downloads/
Create a virtual environment and install "podman-compose":
You can now call
podman-compose
from all other directories, because it was put into your search path byactivate.bat
.If you exit this CMD (Windows Command Prompt), you just have to execute the second step again (e.g. calling
activate.bat
).Update: This is the whole input and output on the shell:
Concerning the updated post (python stacktrace): Is
podman.exe
in your path?podman --version
should ouput your podman version – regardless of whether you are in the venv or not. After installing Podman Desktop, this should be in your path.