gimme-aws-creds.cmd can't find Python when it's not named `python3`

See original GitHub issue

If the Python 3 executable on Windows is named python.exe instead of python3.exe, the .cmd file can’t find it.

Expected Behavior

Running gimme-aws-creds.cmd from Windows with Python 3 should work.

Current Behavior

If the executable is named python.exe instead of python3.exe, then gimme-aws-creds.cmd won’t work.

Possible Solution

PR coming…

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

4reactions
drwelbycommented, Apr 23, 2021

If you have Execution Aliases for Python 3 turned on then this fix will find the Aliases first and you’ll get the error message:

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

even if you have Python 3 installed via other methods, such as Anaconda.

So if you get that error message but python3 works to start Python, go to Settings > App Execution Aliases, and turn off any you see for Python.

Screen Shot 2021-04-22 at 2 55 38 PM

I suspect that the fix that is finding python3 in the expression "%%~$PATH:j" is also the cause of @MarkEvansHW 's problem, finding Program Files instead of appdata directory and then not escaping the space.

edit:

%~$P:i - searches the directories listed in the P environment variable
         and expands %i to the fully qualified name of the first one found.
2reactions
drwelbycommented, May 17, 2021

Some other solutions that can work if your desired Python runs:

Copy gimme-aws-creds/blob/master/bin/gimme-aws-creds to the desktop, rename to gimme-aws-creds.py, right-click and make sure “Open with” is set to your Python. User can then double-click it.

or

Make a file called gimme-aws-creds.bat with contents start cmd /k python -c "from gimme_aws_creds.main import GimmeAWSCreds; GimmeAWSCreds().run()"

or

In Powershell, run Function gimme_fn {python -c "from gimme_aws_creds.main import GimmeAWSCreds; GimmeAWSCreds().run()" }; Set-Alias -Name gimme-aws-creds -Value gimme_fn

Read more comments on GitHub >

github_iconTop Results From Across the Web

gimme-aws-creds throws error while registering the MFA ...
Python 3.10.5 pip3 22.1.2 gimme-aws-creds 2.4.0. When I execute the gimme-aws-creds --register-device command to register MFA device I get ...
Read more >
gimme-aws-creds - Python Package Health Analysis
A CLI to get temporary AWS credentials from Okta For more information about how to use this ... Looks like gimme-aws-creds is missing...
Read more >
nekonyuu/gimme-aws-creds
gimme-aws-creds is a CLI that utilizes an Okta IdP via SAML to acquire temporary AWS credentials via AWS STS. Okta is a SAML...
Read more >
Python is not recognized as an internal or external command
Python 3 Course: https://bit.ly/ python3 -mastery python 2.7 is not recognized as an internal or external commandHow to fix python is not ......
Read more >
Gimme AWS Creds - Installation and Usage
If you are not familiar, gimmie-aws-creds is, “A CLI that utilizes Okta IdP via SAML to acquire temporary AWS credentials.” You can find...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found