gimme-aws-creds icon indicating copy to clipboard operation
gimme-aws-creds copied to clipboard

Gimme-aws-creds no longer works in Powershell after updating from 2.3.1 to 2.3.3

Open privojaime opened this issue 4 years ago • 22 comments

2.3.1 was running perfectly today in Powershell. As soon as I ran pip3 install --upgrade gimme-aws-creds, I type in gimme-aws-creds and I get nothing. Not sure how I can see the errors, or force an install of the older version (I'm currently working on that)

Thanks! -Jaime

privojaime avatar Mar 26 '20 17:03 privojaime

I got the same error. And nothing seems to fix it.

bicasoft avatar Mar 27 '20 18:03 bicasoft

Just adding so we can see how many are impacted by this. I have the same issue, I rolled back with pip uninstall gimme-aws-creds and then pip install gimme-aws-creds==2.3.1 and that seems get things working again.

curtis-turner avatar Mar 30 '20 13:03 curtis-turner

In 2.3.2 there was a change to the batch file that enforced the use of Python 3 in environments where more than one version of Python is installed.

#185

Can you guys elaborate more on your Windows environment please?

Sector95 avatar Mar 30 '20 15:03 Sector95

Hey @Sector95 my environment is as follows

I only have Python 3.8.2 installed, windows 10, I manage my dependencies using pipenv. I flipped the echo OFF to ON to see the output and here is what i got.

"C:\Users\Curtis Turner\AppData\Local\Microsoft\WindowsApps\python3.exe" -x "C:\Users\Curtis Turner.virtualenvs\aws_scripts-15QqIJ3N\Scripts\gimme-aws-creds.cmd"

So it looks like it is detecting a different version of python 3 than it should I am looking into how to remove that if possible. hopefully this helps let me know if you need any more details.

I found this helpful link here on how to disable the windows apps python alias

https://superuser.com/questions/1437590/typing-python-on-windows-10-version-1903-command-prompt-opens-microsoft-stor

it helped but still not running correctly.

Here is the full error output

`gimme-aws-creds.cmd

REM="""

setlocal

set PythonExe=""

set PythonExeFlags=

for %i in (cmd bat exe) do (for %j in (python3.%i) do (call :SetPythonExe "%~$PATH:j" ) )

(for %j in (python3.cmd) do (call :SetPythonExe "%~$PATH:j" ) )

(call :SetPythonExe "" )

if not [""] == [""] (if [""] == [""] (set PythonExe="" ) )

goto :EOF

(for %j in (python3.bat) do (call :SetPythonExe "%~$PATH:j" ) )

(call :SetPythonExe "" )

if not [""] == [""] (if [""] == [""] (set PythonExe="" ) )

goto :EOF

(for %j in (python3.exe) do (call :SetPythonExe "%~$PATH:j" ) )

(call :SetPythonExe "" )

if not [""] == [""] (if [""] == [""] (set PythonExe="" ) )

goto :EOF

for /F "tokens=2 delims==" %i in ('assoc .py') do (for /F "tokens=2 delims==" %j in ('ftype %i') do (for /F "tokens=1" %k in ("%j") do (call :SetPythonExe %k ) ) )

(for /F "tokens=2 delims==" %j in ('ftype pyautofile') do (for /F "tokens=1" %k in ("%j") do (call :SetPythonExe %k ) ) )

(for /F "tokens=1" %k in (""C:\Users\Curtis Turner\AppData\Local\Programs\Python\Python38-32\python.exe"") do (call :SetPythonExe %k ) )

(call :SetPythonExe "C:\Users\Curtis )

if not ["C:\Users\Curtis"] == [""] (if [""] == [""] (set PythonExe="C:\Users\Curtis" ) )

goto :EOF

"C:\Users\Curtis" -x "C:\Users\Curtis Turner\AppData\Local\Programs\Python\Python38-32\Scripts\gimme-aws-creds.cmd" '"C:\Users\Curtis"' is not recognized as an internal or external command, operable program or batch file.

exit /B 9009`

curtis-turner avatar Mar 30 '20 19:03 curtis-turner

Hm. Looks like the space in your user folder's name is causing issues... Let me see what I can find.

Sector95 avatar Mar 30 '20 19:03 Sector95

Hi Sector95, I also have Python 3.8.2 and Windows 10. I have installed Python via Chocolatey v0.10.15

bicasoft avatar Mar 30 '20 20:03 bicasoft

Can you guys pull down this branch and test it for me? https://github.com/Nike-Inc/gimme-aws-creds/tree/win-path-fix

pip uninstall gimme-aws-creds
git clone https://github.com/Nike-Inc/gimme-aws-creds/tree/win-path-fix
cd \path\to\gimme-aws-creds
pip install .

Sector95 avatar Mar 30 '20 20:03 Sector95

Just tested it got another error.

gimme-aws-creds The syntax of the command is incorrect.

curtis-turner avatar Mar 30 '20 20:03 curtis-turner

Thanks for the testing help!

I think we've got it this time, if you would uninstall, reinstall, and test like above one more time, I'd appreciate it!

Sector95 avatar Mar 30 '20 21:03 Sector95

Sure thing give me a few minutes and i'll report back.

Here is the output still not working.

gimme-aws-creds.cmd '"C:\Users\Curtis"' is not recognized as an internal or external command, operable program or batch file.

curtis-turner avatar Mar 30 '20 21:03 curtis-turner

I think I got it fixed with some messing about with the cmd file let me pull the repo and push my edits.

this seemed to make it work -> "tokens=1 delims=^"

curtis-turner avatar Mar 30 '20 22:03 curtis-turner

Odd, that was working on my Windows machine... Makes me nervous that we're getting such divergent behavior.

The odd thing with that solution is that we've opened the quotes, then escaped the closing quote... I'll try it on my machine as well.

Sector95 avatar Mar 30 '20 22:03 Sector95

Yeah that does seem weird.... I think I might move to just using the docker container for this since that should at least isolate the environment to inside the container.

curtis-turner avatar Mar 30 '20 22:03 curtis-turner

I just tested it again with this change - "tokens=1 delims=" and it seems to work as well so that might be a better solution as it does not escape the last double quote.

curtis-turner avatar Mar 30 '20 23:03 curtis-turner

That behavior doesn't work on my end, because the output of the ftype command on my computer has multiple values output:

C:\WINDOWS\system32>assoc .py
.py=Python.File

C:\WINDOWS\system32>ftype Python.File
Python.File="C:\WINDOWS\py.exe" "%L" %*

delims= causes it to capture the whole line, whereas we just want the first object in quotes.

Sector95 avatar Mar 31 '20 16:03 Sector95

I moved my Python install to my root C:\ and I get the same results from those commands for the file association. This also gets rid of the space in the path issue as its just at C:\Python38-32

assoc .py .py=Python.File

ftype Python.File Python.File="C:\Windows\py.exe" "%L" %*

and i reinstalled gimme-aws-creds==2.3.3 from pypi and it is working in my current configuration

curtis-turner avatar Mar 31 '20 20:03 curtis-turner

Greetings- any updates on the best way to get the latest version working on Windows 10? I'm still having issues past 2.3.1. Thank you!

lw-cchapin avatar Nov 02 '20 21:11 lw-cchapin

Would love to see this fixed so we can reliably use >2.3.1 on Windows machines

kylecompassion avatar May 27 '21 19:05 kylecompassion

agreed.. I have not been able to update for a while now. I tried again yesterday to see if the issue reported in https://github.com/Nike-Inc/gimme-aws-creds/issues/302 would be resolved by the upgrade. It wasn't of course.

Now that the proposed fix is being merged, if it is not packported to 2.3.1 then windows users will still have issues.

Of course we can manually update the code but this is not ideal.

iniquityx2 avatar Jun 29 '21 15:06 iniquityx2

Greetings- any updates on the best way to get the latest version working on Windows 10? I'm still having issues past 2.3.1. Thank you!

Not sure of the reasonings - but between Python 3.9.6 and gimme-aws-creds 2.4.3 this is now working on Windows 10 for me, where I was previously stuck on 2.3.1.

lw-cchapin avatar Jun 30 '21 15:06 lw-cchapin

@PrivoChapin I tried that fix but it didn't pan out for me. I used the windows 64 installer on (https://www.python.org/downloads/release/python-396/), chose to add python to environment checkbox of course. Then did pip3 install --upgrade gimme-aws-creds

However, after that changed the error and that lead me to this stack exchange article.

error:

"Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases."

https://stackoverflow.com/questions/65348890/python-was-not-found-run-without-arguments-to-install-from-the-microsoft-store

Using the second suggestion "3.Go to -> "start" and type "Manage App Execution Aliases" .Go to it and turn off "python"

and unchecking both of the python radio dots worked.

iniquityx2 avatar Jul 19 '21 18:07 iniquityx2

which is also apparently solved here lol

https://github.com/Nike-Inc/gimme-aws-creds/issues/257

iniquityx2 avatar Jul 19 '21 18:07 iniquityx2