This guide helps you set up a local development environment for the vortex-sdk-python package.
If you installed Python with Homebrew, you may encounter permission issues with system-wide installations. The solution is to use a virtual environment.
# Navigate to project directory
cd vortex-python-sdk
# Create virtual environment using Homebrew Python
python3 -m venv venv
# Alternative: specify explicit Python version
/opt/homebrew/bin/python3 -m venv venv# On macOS/Linux
source venv/bin/activate
# On Windows
venv\Scripts\activateAfter activation, your terminal prompt should show (venv) prefix.
pip install --upgrade pip setuptools wheel# Install package with all development dependencies
pip install -e ".[dev]"# Install npm dependencies (required for the SDK)
npm install# Test import
python -c "from vortex_sdk import VortexSDK; print('✓ Import successful')"
# Run tests
pytest
# Check Node.js SDK is accessible
node -e "require.resolve('@vortexfi/sdk')"# 1. Create and activate venv
python3 -m venv venv
source venv/bin/activate
# 2. Upgrade pip
pip install --upgrade pip setuptools wheel
# 3. Install Node.js dependencies
npm install
# 4. Install Python package in development mode
pip install -e ".[dev]"
# 5. Install pre-commit hooks (optional)
pre-commit install
# 6. Verify everything works
python -c "from vortex_sdk import VortexSDK; print('✓ Ready!')"
pytestWhen you're done working:
deactivateProblem: Cannot install packages due to system protection.
Solution: Always use a virtual environment (venv). Never use sudo pip.
# Create venv if you haven't
python3 -m venv venv
source venv/bin/activate
pip install -e ".[dev]"Problem: Python not in PATH or not installed.
Solution:
# Install Python via Homebrew
brew install python@3.11
# Use explicit path
/opt/homebrew/bin/python3 -m venv venvProblem: Node.js not installed.
Solution:
# Install Node.js via Homebrew
brew install node
# Verify installation
node --version
npm --versionProblem: npm dependencies not installed.
Solution:
# Install npm dependencies
npm install
# Or install globally
npm install -g @vortexfi/sdkProblem: source venv/bin/activate doesn't work.
Solution:
# Try with dot notation
. venv/bin/activate
# Or use full path
source /Users/yourname/vortex-python-sdk/venv/bin/activateProblem: Package not installed in development mode.
Solution:
# Make sure venv is activated
source venv/bin/activate
# Install in development mode
pip install -e .If you need to test with different Python versions:
# Create venv with specific Python version
python3.9 -m venv venv39
python3.10 -m venv venv310
python3.11 -m venv venv311
# Activate the one you want
source venv39/bin/activate
pip install -e ".[dev]"
pytest- Install Python extension
- Select interpreter:
Cmd+Shift+P→ "Python: Select Interpreter" - Choose
./venv/bin/python
Add to .vscode/settings.json:
{
"python.defaultInterpreterPath": "${workspaceFolder}/venv/bin/python",
"python.terminal.activateEnvironment": true,
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.ruffEnabled": true
}- File → Settings → Project → Python Interpreter
- Click gear icon → Add
- Select "Existing environment"
- Choose
venv/bin/python
# 1. Activate venv
source venv/bin/activate
# 2. Make your changes
# ... edit code ...
# 3. Run tests
pytest
# 4. Format code
black src/ tests/ examples/
# 5. Check linting
ruff check src/ tests/ examples/
# 6. Type check
mypy src/
# 7. When done
deactivate# Activate venv
source venv/bin/activate
# Run example
python examples/brl_onramp_example.py# Activate venv
source venv/bin/activate
# Update Python dependencies
pip install --upgrade -e ".[dev]"
# Update Node.js dependencies
npm updateIf you encounter issues, start fresh:
# Remove virtual environment
rm -rf venv
# Remove Python build artifacts
rm -rf build/ dist/ *.egg-info src/*.egg-info
# Remove Node.js dependencies
rm -rf node_modules package-lock.json
# Start over
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip setuptools wheel
npm install
pip install -e ".[dev]"- Always use venv - Never install packages globally or with sudo
- Activate before working - Always activate venv before development
- Keep it updated - Regularly update pip and dependencies
- Test in clean environment - Occasionally test in a fresh venv
- Don't commit venv - The
venv/directory is in.gitignore