Home > database >  Getting error while running aws cli commands in cygwin
Getting error while running aws cli commands in cygwin

Time:08-19

I have installed Python in Cygwin as well as in windows. I have installed AWS CLI in windows. it is working fine in command prompt. But in Cygwin it is not working. showing error. Please find the steps which I did to configure.

 $ which python
 /usr/bin/python

This is Cygwin Python

$ aws --version
 C:\Users\Anna\AppData\Local\Programs\Python\Python310\python.exe: can't open file 
'C:\\cygdrive\\c\\Users\\Anna\\AppData\\Local\\Programs\\Python\\Python310\\Script
s\\aws': [Errno 2] No such file or directory

This is the error I am facing. Struggling for last 2 days. I reinstalled Cygwin as well.

I tried

 hash aws
 hash -t aws 

Not works for me. Any help will be much appreciated.

CodePudding user response:

Can you try to insert following script snippet at the very top of C:\Users\Anna\AppData\Local\Programs\Python\Python310\Scripts\aws (After making a backup copy of aws, of course)

#!/bin/bash
""":"
exec C:/Users/Anna/AppData/Local/Programs/Python/Python310/python.exe $(cygpath -m $0) ${1 "$@"}
"""
  • Related