AWS Development is best done by leveraging *nix environments. Be it BSD on Mac or any of the linux distro's, they natively have python installed and their package managers understand how to upgrade and install the Python environments. In Windows, we don't have that luxury and need to leverage the newer integration models Windows has been promoting using WSL.
Assuming you are running Windows 10 or newer operating system all the below commands should work as expected. First we need to open a Powershell window in Administrator mode. This can be done with the following:
Open the Start Menu
Type in Powershell
Right click "Windows Powershell" App icon and select "Run As Administrator"
Enter the following commands into the terminal that appears to enable the required Windows features.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2
Go to the following link to launch the Microsoft and install Ubuntu 20.04 Store https://www.microsoft.com/store/productId/9MTTCL66CPXJ
I would also recommend using the new Window Terminal app for interactions with the linux CLI as it allows you to have multiple environments tabbed within the same Application. For instance you can have a Powershell, CMD & Ubuntu Terminal all as tabs in the same App. https://www.microsoft.com/store/productId/9N0DX20HK701
Download the Pycharm Application (Community version does not support the features we are trying to use)
At this point it is important to jump to the "Setting up your Python Environment" section before proceeding.
Once the Pycharm application is installed go to: Settings -> Project -> Python -> Interpreter -> Gear Icon -> Add
Select WSL
Change the python path to: /home/<username>/.pyenv/shims/python which will allow pycharm to dynamically pickup your python environment as you switch between virtual environments.
You may want to install docker on windows and follow their WSL guide to build your AWS code in a container as Ubuntu builds are not compatible with the AWS environment. https://docs.docker.com/desktop/windows/install/
At this point you should have both the Window Terminal application installed and WSL setup.
Open an "Ubuntu" shell in Windows Terminal
Enter the following commands as needed:
> cd ~
> sudo apt update
> sudo apt upgrade
> sudo apt install build-essential curl libbz2-dev libffi-dev liblzma-dev \
libncursesw5-dev libreadline-dev libsqlite3-dev libssl-dev libxml2-dev \
libxmlsec1-dev llvm make tk-dev wget xz-utils zlib1g-dev
> mkdir repos
> sudo apt install zsh
> chsh -s $(which zsh)
> sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
> git clone https://github.com/pyenv/pyenv.git ~/.pyenv
> echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
> echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrv
> echo 'eval "$(pyenv init --path)"' >> ~/.zshrc
> echo 'eval "$(pyenv init -)"' >> ~/.zshrc
> echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zshrc
> echo 'export PATH="/home/$(whoami)/.local/bin:$PATH"' >> ~/.zshrc
> exec "$SHELL"
> git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
> pyenv install 3.8.13
> pyenv virtualenv 3.8.13 dev
> pyenv global dev
> sudo apt install python3-pip
> python -m pip install pipx
> pipx install awscli
> pipx install aws-sso-util
> pipx install aws-sam-cli
> pip install click git-remote-codecommit boto3