This guide provides a step-by-step walkthrough for setting up the Hiero Python SDK development environment specifically for Windows users. We will use PowerShell and uv for dependency management.
- Prerequisites
- Fork and Clone
- Add Upstream Remote
- Install uv
- Install Dependencies
- Optional Dependencies
- Generate Protobufs
- Environment Setup
- Verify Your Setup
- Troubleshooting
Before you begin, ensure you have the following installed on your system:
- Git for Windows: Download and install Git.
- Python 3.10+: Download and install Python. Ensure "Add Python to PATH" is checked during installation.
- GitHub Account: You will need a GitHub account to fork the repository.
- Chocolatey: For Windows 10 users, you must install Chocolatey. Install Chocolatey. Make sure Chocolatey is added to PATH.
- Navigate to the hiero-sdk-python repository and click the Fork button.
- Open PowerShell and run the following commands to clone your fork:
# Clone the repository
git clone https://github.com/<your-username>/hiero-sdk-python.git
# Navigate into the project directory
cd hiero-sdk-pythonConnect your local repository to the original Hiero SDK repository. This allows you to keep your fork synchronized with the latest changes.
git remote add upstream https://github.com/hiero-ledger/hiero-sdk-python.gitWhat this does:
origin= your fork (where you push your changes)upstream= the original repository (where you pull updates from)
Verify your remotes are configured correctly:
git remote -vYou should see:
origin https://github.com/<your-username>/hiero-sdk-python.git (fetch)
origin https://github.com/<your-username>/hiero-sdk-python.git (push)
upstream https://github.com/hiero-ledger/hiero-sdk-python.git (fetch)
upstream https://github.com/hiero-ledger/hiero-sdk-python.git (push)
The Hiero Python SDK uses uv for extremely fast Python package and environment management.
- In your PowerShell window, run the following command to install
uv:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
⚠️ Important: After the installation finishes, you must close your current PowerShell window and open a new one for the changes to take effect. Alternatively, you can reload your environment variables.
- Verify the installation by running:
uv --versionOnce uv is installed and you are inside the project directory, run:
uv syncThis command will:
- Download and install the correct Python version (if needed)
- Create a virtual environment
- Install all project dependencies
- Install development tools (pytest, ruff, etc.)
Some SDK features (such as Ethereum-related functionality) rely on optional dependencies that are not installed by default.
These optional dependencies are required for:
- Integration tests covering ETH-specific features
- Running ETH-related example scripts
If you are working on ETH functionality, running ETH-related tests, or executing ETH examples, install the ETH extra explicitly:
uv sync --dev --extra ethTo install all available extras (useful for full-matrix testing):
uv sync --dev --all-extrasThe SDK requires generated protobuf files to communicate with the network. Run the following command to generate them:
uv run python generate_proto.pyCreate a .env file in the project root for your Hedera testnet credentials:
Copy-Item .env.example .envEdit the .env file with your credentials:
OPERATOR_ID=0.0.YOUR_ACCOUNT_ID
OPERATOR_KEY=your_private_key_here
NETWORK=testnet
Don't have a testnet account? Get free testnet credentials at Hedera Portal
Optional environment variables:
ADMIN_KEY=...
SUPPLY_KEY=...
FREEZE_KEY=...
RECIPIENT_ID=...
TOKEN_ID=...
TOPIC_ID=...
VERIFY_CERTS=true # Enable certificate verification for TLS (default: true)
These are only needed if you're customizing example scripts.
Run the unit test suite to ensure your local setup is working:
uv run pytest tests/unitYou should see unit tests passing. Integration tests are expected to fail locally without the required network/test environment.
If you encounter errors, check that:
- All dependencies installed correctly (
uv sync) - Protocol buffers were generated (
uv run python generate_proto.py) - Your
.envfile has valid credentials
If you receive an error stating that uv is not recognized as a cmdlet or function, ensure that the installation path (typically %USERPROFILE%\.local\bin) is added to your Windows Environment Variables (PATH).
If you encounter errors running scripts in PowerShell, you may need to adjust your execution policy. Run PowerShell as an Administrator and execute:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserEnsure dependencies and protobufs are installed:
uv sync
uv run python generate_proto.pyCheck your .env file:
- Is
OPERATOR_IDcorrect? - Is
OPERATOR_KEYcorrect? - Is
NETWORKset totestnet?
Test your credentials at Hedera Portal
While this guide focuses on PowerShell, you can also use Git Bash. If using Git Bash, follow the Standard Setup Guide as it behaves similarly to a Unix shell.
- Installation issues? Check the uv documentation
- Hedera testnet? Visit Hedera Portal
- Git questions? See Git Basics
- General questions? Ask on the Linux Foundation Decentralized Trust Discord