Install AWS Cli on Windows correctly

Javier Moreno Valle
3 min readApr 17, 2019

--

To install the AWS client in windows, we can directly download the .msi installer from the web:

If we do it in this way, the AWS client will be installed correctly but in the case of Windows, installing it in this way will make us certain problems when working with it. For example at the time of uploading our project to the AWS bucket.

This could be a the example of an error that we could get it:

upload failed: … An HTTP Client raised and unhandled exception: unknown encoding: idna

Even in 90% of the cases, it will throw us error when making the invalidations

Solution:

All these errors that we can get is by the fact of having used the installer .msi.

The solution is to install it using Python.

Steps to follow:

  • Download Python and install it (if you don’t have). You can download it from here.
  • Now we need to add python to the system path
  • In the Windows search bar, start to type until python executable appears, but don’t click on it in the menu. Instead, right-click on it, and select Open file location
  • A window will open up with some files and folders: this should be where Python is installed. Right-click on the address bar at the top and select Copy address as text.

Note: if the address bar contains the words Start menu, then you are probably looking at a shortcut to Python. Right-click on the file called Python 3.x (where 3.x is the version number of your Python installation) and select Open file location until you see a folder containing a file called python.exe.

  • Now open a comand line as administrator. Write sysdm.cpl and press enter
  • Click on Environment variables. In the System Variables section, look for the PATH environment variable and select it. Click on Edit If the PATH environment variable does not exist, click New.
  • In the Edit System Variable (or New System Variable) window, you must specify the value of the PATH (python executable path) environment variable. Close all other windows by clicking OK.
  • Now, close console, open it again a you can do next:
  • Now that we have python, we need “pip” to install the AWS client
  • Go to this link, copy the content, create a new file where you want and paste the content.
  • Now, in the console (in the path where you created the file), type the following :
python get-pip.py
  • Like Python, we must add it to the system path typing the following in the console:
  • setx PATH “C:\Users\%user%\“AppData\Local\Programs\Python\Python37–32”\Scripts”
  • Now that we have python and pip configured, the last step is to install the aws client with the following command
pip install awscli
  • If all the steps have been followed correctly, everything should work correctly.

Thanks for reading my article.
Sharing can be helpful for others.

--

--