Development Environment Setup Guide on Windows (Native)
Development Environment Setup Guide on Windows (Native)
Section titled “Development Environment Setup Guide on Windows (Native)”Introduction
Section titled “Introduction”This guide establishes a native Windows development environment for the GenAI IDP accelerator using PowerShell, Git Bash, or Windows Terminal.
Purpose: Provides a straightforward setup process for Windows users who prefer native tools over WSL, ensuring compatibility with the project’s AWS infrastructure.
When to use this guide:
- You’re developing on Windows and want to use native Windows tools
- You prefer PowerShell or Git Bash over WSL
- You want a lightweight setup without Linux emulation
Alternative: If you prefer a Linux environment on Windows, see Setup Guide for WSL.
Prerequisites
Section titled “Prerequisites”Required Software
Section titled “Required Software”-
Python 3.12 or higher
- Download from: https://www.python.org/downloads/
- ⚠️ Important: Check “Add Python to PATH” during installation
- Verify:
python --versionorpython3 --version
-
Node.js 22.12 or higher
- Download from: https://nodejs.org/
- Installs both Node.js and npm
- Verify:
node --versionandnpm --version
-
Git for Windows
- Download from: https://git-scm.com/download/win
- Installs Git Bash shell
- Verify:
git --version
-
AWS CLI v2
- Download from: https://aws.amazon.com/cli/
- Verify:
aws --version
-
AWS SAM CLI
- Download from: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html
- Verify:
sam --version
-
Docker Desktop (optional, for local Lambda testing)
- Download from: https://www.docker.com/products/docker-desktop/
- Required only if you want to test Lambda functions locally with
sam local invoke
Step 1: Clone the Repository
Section titled “Step 1: Clone the Repository”Open PowerShell, Git Bash, or Windows Terminal:
git clone https://github.com/aws-solutions-library-samples/accelerated-intelligent-document-processing-on-aws.gitcd accelerated-intelligent-document-processing-on-awsStep 2: Create Python Virtual Environment
Section titled “Step 2: Create Python Virtual Environment”Using PowerShell:
# Create virtual environmentpython -m venv .venv
# Activate virtual environment.\.venv\Scripts\Activate.ps1
# If you get an execution policy error, run:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserUsing Git Bash:
# Create virtual environmentpython -m venv .venv
# Activate virtual environmentsource .venv/Scripts/activateYou should see (.venv) at the beginning of your prompt when activated.
Step 3: Install the IDP CLI
Section titled “Step 3: Install the IDP CLI”⚠️ Critical: Install packages in this exact order to avoid “No such command” errors.
pip install -e lib/idp_common_pkgpip install -e lib/idp_sdkpip install -e lib/idp_cli_pkgNote: This installs the
idp-clicommand along with all required Python dependencies.
Step 4: Configure AWS CLI
Section titled “Step 4: Configure AWS CLI”Refer to: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html
aws configureStep 5: Test the Build
Section titled “Step 5: Test the Build”Test CLI help
Section titled “Test CLI help”idp-cli publish --helpTest build
Section titled “Test build”Standard build and publish:
idp-cli publish --source-dir . --region us-east-1Troubleshooting Build Issues
Section titled “Troubleshooting Build Issues”If the build fails, use the --verbose flag to see detailed error messages:
idp-cli publish --source-dir . --region us-east-1 --verboseThe verbose flag will show:
- Exact SAM build commands being executed
- Complete error output from failed builds
- Python version compatibility issues
- Missing dependencies or configuration problems
Note: The legacy
publish.pyscript is deprecated. Useidp-cli publishfor all new builds.