|
| 1 | +# Windows Setup Guide |
| 2 | + |
| 3 | +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. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Table of Contents |
| 8 | +- [Prerequisites](#prerequisites) |
| 9 | +- [Fork and Clone](#fork-and-clone) |
| 10 | +- [Install uv](#install-uv) |
| 11 | +- [Install Dependencies](#install-dependencies) |
| 12 | +- [Generate Protobufs](#generate-protobufs) |
| 13 | +- [Troubleshooting](#troubleshooting) |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## Prerequisites |
| 18 | + |
| 19 | +Before you begin, ensure you have the following installed on your system: |
| 20 | + |
| 21 | +1. **Git for Windows**: [Download and install Git](https://gitforwindows.org/). |
| 22 | +2. **Python 3.10+**: [Download and install Python](https://www.python.org/downloads/windows/). Ensure "Add Python to PATH" is checked during installation. |
| 23 | +3. **GitHub Account**: You will need a GitHub account to fork the repository. |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## Fork and Clone |
| 28 | + |
| 29 | +1. Navigate to the [hiero-sdk-python repository](https://github.com/hiero-ledger/hiero-sdk-python) and click the **Fork** button. |
| 30 | +2. Open **PowerShell** and run the following commands to clone your fork: |
| 31 | + |
| 32 | +```powershell |
| 33 | +# Clone the repository |
| 34 | +git clone https://github.com/<your-username>/hiero-sdk-python.git |
| 35 | +
|
| 36 | +# Navigate into the project directory |
| 37 | +cd hiero-sdk-python |
| 38 | +``` |
| 39 | +--- |
| 40 | + |
| 41 | +## Install uv |
| 42 | + |
| 43 | +The Hiero Python SDK uses `uv` for extremely fast Python package and environment management. |
| 44 | + |
| 45 | +1. In your PowerShell window, run the following command to install `uv`: |
| 46 | + |
| 47 | +```powershell |
| 48 | +powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" |
| 49 | +``` |
| 50 | + |
| 51 | +> ⚠️ **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. |
| 52 | +
|
| 53 | +2. Verify the installation by running: |
| 54 | +```powershell |
| 55 | +uv --version |
| 56 | +``` |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +## Install Dependencies |
| 61 | + |
| 62 | +Once `uv` is installed and you are inside the project directory, run: |
| 63 | + |
| 64 | +```powershell |
| 65 | +uv sync |
| 66 | +``` |
| 67 | + |
| 68 | +This command will create a virtual environment and install all necessary development dependencies automatically. |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +## Generate Protobufs |
| 73 | + |
| 74 | +The SDK requires generated protobuf files to communicate with the network. Run the following command to generate them: |
| 75 | + |
| 76 | +```powershell |
| 77 | +uv run python generate_proto.py |
| 78 | +``` |
| 79 | + |
| 80 | +--- |
| 81 | + |
| 82 | +## Troubleshooting |
| 83 | + |
| 84 | +### `uv` is not recognized |
| 85 | +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). |
| 86 | + |
| 87 | +### Execution Policy Restrictions |
| 88 | +If you encounter errors running scripts in PowerShell, you may need to adjust your execution policy. Run PowerShell as an Administrator and execute: |
| 89 | +```powershell |
| 90 | +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser |
| 91 | +``` |
| 92 | + |
| 93 | +### Git Bash Alternative |
| 94 | +While this guide focuses on PowerShell, you can also use **Git Bash**. If using Git Bash, follow the [Standard Setup Guide](02_installing_hiero_python_sdk.md) as it behaves similarly to a Unix shell. |
| 95 | + |
0 commit comments