This is still an issue even with the latest version of AWS cli. So after some trial and error I found a pretty good workaround that will not make you switch your favorite shell.
First, make sure python is on your PATH. That is from anywhere in the system you can just run python and it work.
Find the aws script and open it for editing (for me it was located in c:\Program Files\Python36\Scripts\aws
) and change the hashbang (that would be the first line in the script) to #!python.exe
. For me it was set to #!c:\Program Files\Python36\python.exe
. That space in the middle of Program Files
caused the issue when that path got converted to Linux like path. Changing it to #!python.exe
sidesteps the issue.
When you update AWS cli, repeat the workaround.
PS. You could also avoid this issue by installing python somewhere in a folder without spaces in path. That requires to reconfigure your system, so I did not do that myself.