Skip to content

Installation

Complete installation guide for pyvider-hcl.

Prerequisites

Installing UV

Python Version Setup

Virtual Environment

Installing pyvider-hcl

uv add pyvider-hcl

Using pip

pip install pyvider-hcl

From Source

For development or accessing the latest features:

# Clone the repository
git clone https://github.com/provide-io/pyvider-hcl.git
cd pyvider-hcl

# Set up environment and install
uv sync

# Verify installation
python -c "import pyvider.hcl; print('✅ pyvider-hcl installed')"

Verification

After installation, verify everything works:

# Check Python version
python --version  # Should show 3.11+

# Verify package installation
python -c "import pyvider.hcl; print(pyvider.hcl.__version__)"

# Run a simple parse test
python -c "from pyvider.hcl import parse_hcl_to_cty; result = parse_hcl_to_cty('name = \"test\"'); print('✅ HCL parsing works')"

Dependencies

pyvider-hcl requires:

  • python-hcl2: HCL parsing library
  • pyvider-cty: CTY type system integration
  • provide-foundation: Logging and error handling
  • regex: Enhanced regular expression support

These are installed automatically when you install pyvider-hcl.

Troubleshooting

HCL-Specific Issues

Problem: ImportError: cannot import name 'parse_hcl_to_cty'

Solution: Ensure you have the latest version installed:

uv add pyvider-hcl --upgrade

Problem: HCL parsing errors

Solution: Verify your HCL syntax: - Check for proper quoting of strings - Ensure proper nesting of blocks - Validate type expressions (e.g., list(string))

Next Steps

After installation:

  1. Getting Started - Learn HCL parsing basics
  2. User Guide - Comprehensive usage examples
  3. API Reference - Complete API documentation