Last Verified: 2025-01-27
Prerequisites
Before installing the HopX Python SDK, ensure you have:- Python 3.8+ (CPython recommended)
- pip (Python package installer)
- HopX API key - Get yours at console.hopx.dev
Install from PyPI
The recommended way to install the HopX Python SDK:Install Specific Version
Install a specific version:Install from Source
For development or to use the latest unreleased version:Verify Installation
Verify the installation:0.3.0
Set Up Authentication
The SDK requires an API key for authentication. You have three options:Option 1: Environment Variable (Recommended)
Set theHOPX_API_KEY environment variable:
Option 2: Pass API key Directly
Pass the API key when creating a sandbox:Option 3: Configuration File
Create a.env file in your project root:
Get Your API key
- Sign up at console.hopx.dev
- Navigate to Settings → API Keys
- Create a new API key
- Copy the key (you’ll only see it once)
API keys are scoped to your account and have full access to create, manage, and delete sandboxes. Keep them secure.
Supported Python Versions
The SDK is tested and supported on:- Python 3.8 - Minimum supported version
- Python 3.9 - Recommended for best compatibility
- Python 3.10 - Recommended for new projects
- Python 3.11 - Recommended for new projects
- Python 3.12 - Latest, fully supported
Package Managers
pip
poetry
pipenv
conda
Dependencies
The SDK has minimal dependencies:requests- HTTP client for API callswebsocket-client- WebSocket support for streamingtyping-extensions- Type hints for Python < 3.10
pip install hopx-ai.
Troubleshooting
Import Errors
If you getModuleNotFoundError: No module named 'hopx_ai':
- Verify Python version:
python --version(should be 3.8+) - Check installation:
pip list | grep hopx-ai - Reinstall:
pip install --upgrade hopx-ai
Authentication Errors
If you get authentication errors:- Verify API key is set:
echo $HOPX_API_KEY(Linux/macOS) orecho %HOPX_API_KEY%(Windows) - Check API key is valid at console.hopx.dev
- Ensure no extra spaces or quotes in the API key
Network Errors
If you encounter network errors:- Check internet connection
- Verify firewall allows outbound HTTPS (port 443)
- Check if you’re behind a corporate proxy (may need proxy configuration)
Related
- Python SDK Quickstart - Get started with the SDK
- [API key Management](/API key) - Learn about API key security
- Sandbox Class Reference - Complete SDK reference
Next Steps
Once you’ve successfully installed the SDK:- Quickstart Guide - Create your first sandbox and run code
- CLI Installation - Install the HopX CLI as an alternative
- API Reference - Explore the full SDK API

