This guide walks you through setting up your development environment for contributing to the Hiero Python SDK.
- Repository Setup
- Installation
- Generate Protocol Buffers
- Environment Setup
- Setup Checklist
- Troubleshooting
Before you begin, make sure you have:
- Git installed (Download Git)
- Python 3.10+ installed (Download Python)
- A GitHub account (Sign up)
Forking creates your own copy of the Hiero Python SDK that you can modify freely.
- Go to https://github.com/hiero-ledger/hiero-sdk-python
- Click the Fork button in the top-right corner
- Select your GitHub account as the destination
You now have your own fork at https://github.com/YOUR_USERNAME/hiero-sdk-python
Clone your fork to your local machine:
git clone https://github.com/YOUR_USERNAME/hiero-sdk-python.git
cd hiero-sdk-pythonReplace YOUR_USERNAME with your actual GitHub username.
Connect 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)
Check that both 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 latest release of this SDK is published to PyPI. You can install it with:
pip install --upgrade pip
pip install hiero-sdk-python
This will pull down a stable release along with the required dependencies.
You can also clone the repo and install dependencies using uv:
uv is an ultra-fast Python package and project manager. It replaces pip, pip-tools, pipx, poetry, pyenv,
virtualenv, and more.
On macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | shOn macOS (using Homebrew):
brew install uvOn Windows:
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"Other installation methods: uv Installation Guide
uv --versionuv automatically manages the correct Python version based on the .python-version file in the project, so you don't need to worry about version conflicts.
uv syncWhat this does:
- Downloads and installs the correct Python version (if needed)
- Creates a virtual environment
- Installs all project dependencies
- Installs development tools (pytest, ruff, etc.)
If you prefer using pip instead of uv, you can install in editable mode:
pip install --upgrade pip
pip install -e .Note: This method requires you to have Python 3.10+ already installed on your system. Changes to your local code will be immediately reflected when you import the SDK.
The SDK uses protocol buffers to communicate with the Hedera network. Generate the Python code from the protobuf definitions:
uv run python generate_proto.pyCreate a .env file in the project root for your Hedera testnet credentials:
cp .env.example .envEdit the .env file with your credentials:
OPERATOR_ID=0.0.YOUR_ACCOUNT_ID
OPERATOR_KEY=your_private_key_here
NETWORK=testnetDon'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=...These are only needed if you're customizing example scripts.
Run the test suite to ensure everything is working:
uv run pytestYou should see tests passing. 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
Make sure uv is in your PATH. After installation, you may need to restart your terminal or run:
source ~/.bashrc # or ~/.zshrc on macOSIf using uv:
uv sync
uv run python generate_proto.pyIf using pip:
pip install -e .
python generate_proto.pyCheck your .env file:
- Is
OPERATOR_IDcorrect? - Is
OPERATOR_KEYcorrect? - Is
NETWORKset totestnet?
Test your credentials at Hedera Portal
- 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 (or, if logged in, straight in the related Hiero Python SDK Group)