Search code examples
pythonamazon-web-servicesamazon-elastic-beanstalkaws-cli

AWS EB CLI - 'eb' is not recognized as an internal or external command


I installed AWS with Python 3.11 in my PC. later I uninstalled Python 3.11 to use Python 3.10 but when I run aws --version it still shows Python 3.11.

enter image description here

When I run other commands like eb init it shows and error:

'eb' is not recognized as an internal or external command,operable program or batch file.

And even if I pip install awsebcli it gets installed in Python 3.10. How to fix this?


Solution

  • The solution is based on this question. Basically both local and roaming filepaths to Python need to be added to the Windows environment variables.

    Go to Start/Edit the system environment variables/Environment Variables... Once opened, select Path variable and Edit. Ensure both local and roaming python file paths are added. Eg:

    C:\Users\Your_user_name\AppData\Local\Programs\Python\Python310\Scripts
    C:\Users\Your_user_name\AppData\Roaming\Python\Python310\Scripts
    

    Once both are included in the Path variable, run in the command prompt pip install awsebcli --upgrade --user. Check it is correctly installed with eb --version.