Closed cmaturi closed 3 years ago
@cmaturi I believe this issue is related to this issue on Stack Overflow:
Python not working in the command line of git bash https://stackoverflow.com/questions/32597209/python-not-working-in-the-command-line-of-git-bash
It seems that the Windows version of Python does not work with Git shell by default. Try running python in Git shell and see if you have the same problem as described in the article above.
If you do, see if the following workaround allows you to run awscli-login
from Git shell:
$ winpty aws login
@cmaturi I believe this issue is related to this issue on Stack Overflow:
Python not working in the command line of git bash https://stackoverflow.com/questions/32597209/python-not-working-in-the-command-line-of-git-bash
It seems that the Windows version of Python does not work with Git shell by default. Try running python in Git shell and see if you have the same problem as described in the article above.
If you do, see if the following workaround allows you to run
awscli-login
from Git shell:$ winpty aws login
The error message I get in git bash complains about my python install location:
bash: /c/Users/zdc/AppData/Roaming/Python/Python38/Scripts/aws: c:\program: bad interpreter: No such file or directory
winpty approach does not work on my machine. For me the issue appeared to be that my default installation of python was at a path that had a space in it: c:\program files\python38\python.exe. To work around this I moved my python install to C:\python38 and updated the shebang in my aws script.
Another workaround that does not involve changing the aws script was running
$ python $(which aws) login
You can also add an alias:
alias aws='python $(which aws)'
and then use aws login
normally
On my machine, git bash works perfectly. Note that the shebang has no spaces in the path.
$ head `which aws`
#!c:\python39\python.exe
# Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
# http://aws.amazon.com/apache2.0/
# or in the "license" file accompanying this file. This file is
aws login hangs out in git shell
cmaturi@CITES-P10R37289 ~/code (master) $ vi ~/.aws/credentials
cmaturi@CITES-P10R37289 ~/code (master) $ aws login