Environment:51bitquant Ai hedge fund crypto Python Env
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Quant_Trading |
| Last Updated | 2026-10-28 09:34 GMT |
Overview
Python 3.12+ runtime with LangChain/LangGraph, pandas, numpy, matplotlib, and the full ai-hedge-fund-crypto dependency stack.
Description
This environment provides the standard Python runtime for running the ai-hedge-fund-crypto trading system. It is built on Python 3.12+ and installs the full dependency set declared in pyproject.toml, including LangChain and LangGraph for LLM-driven decision making, pandas/numpy for data manipulation, matplotlib for equity curve plotting, colorama/tabulate for terminal output, and the python-binance-derived gateway client for market data access. No GPU is required — all computation is CPU-bound.
Usage
Use this environment for any workflow in the repository: backtesting, live trading signals, or custom strategy creation. It is the mandatory prerequisite for every Implementation that does not directly require external API access (Binance or LLM). It must be set up before running main.py or backtest.py.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux / macOS / Windows (WSL2) | Cross-platform Python; terminal coloring via colorama |
| Hardware | CPU-only | No GPU required; all indicator and backtest computation is CPU-bound |
| Disk | 100 MB + cache space | ./cache/ directory stores CSV kline data (size depends on backtest range)
|
| Python | >= 3.12 | Declared in pyproject.toml: requires-python = ">=3.12"
|
Dependencies
System Packages
- Python >= 3.12
git(for cloning)
Python Packages
langchain>= 0.3.24langchain-openai>= 0.3.16langchain-groq>= 0.1.0langchain-google-genai>= 2.1.5langchain-anthropic>= 0.3.15langchain-ollama>= 0.3.3langchain-community>= 0.3.23langgraph>= 0.4.1pandas>= 2.2.3matplotlib>= 3.10.1colorama>= 0.4.6tabulate>= 0.9.0pydantic-settings>= 2.9.1pyyaml>= 6.0.2orjson(viapyyml>= 0.0.2)aiohttp>= 3.11.18requests>= 2.32.3websockets>= 15.0.1pycryptodome>= 3.22.0dateparser>= 1.2.1dotenv>= 0.9.9yarl>= 1.20.0
Credentials
No credentials are required for this environment itself. Credentials for Binance and LLM providers are documented in Environment:51bitquant_Ai_hedge_fund_crypto_Binance_API_Access and Environment:51bitquant_Ai_hedge_fund_crypto_LLM_API_Access respectively. A .env file is loaded at import time via load_dotenv() in settings.py.
Quick Install
# Install all required packages (Python 3.12+ required)
pip install langchain>=0.3.24 langchain-openai>=0.3.16 langchain-groq>=0.1.0 \
langchain-google-genai>=2.1.5 langchain-anthropic>=0.3.15 langchain-ollama>=0.3.3 \
langchain-community>=0.3.23 langgraph>=0.4.1 pandas>=2.2.3 matplotlib>=3.10.1 \
colorama>=0.4.6 tabulate>=0.9.0 pydantic-settings>=2.9.1 pyyaml>=6.0.2 \
pyyml>=0.0.2 aiohttp>=3.11.18 requests>=2.32.3 websockets>=15.0.1 \
pycryptodome>=3.22.0 dateparser>=1.2.1 dotenv>=0.9.9 yarl>=1.20.0
# Or use uv / pip with the project directly
pip install -e .
Code Evidence
Python version requirement from pyproject.toml:5-6:
[project]
requires-python = ">=3.12"
Full dependency list from pyproject.toml:7-31:
dependencies = [
"aiohttp>=3.11.18",
"colorama>=0.4.6",
"langchain>=0.3.24",
"langchain-openai>=0.3.16",
"langgraph>=0.4.1",
"pandas>=2.2.3",
"matplotlib>=3.10.1",
"pydantic-settings>=2.9.1",
# ... (full list above)
]
Config loading at import time from src/utils/settings.py:6-9:
from .constants import Interval
import yaml
from typing import List, Optional
from dotenv import load_dotenv
load_dotenv()
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
ModuleNotFoundError: No module named 'langgraph' |
LangGraph not installed | pip install langgraph>=0.4.1
|
ModuleNotFoundError: No module named 'pydantic_settings' |
pydantic-settings missing | pip install pydantic-settings>=2.9.1
|
ImportError: cannot import name 'Interval' from 'utils' |
Running from wrong working directory | Run from repo root so src is on the path
|
AssertionError on primary_interval |
Config primary_interval not in signals.intervals | Ensure primary_interval value appears in signals.intervals list
|
Compatibility Notes
- Python version: Requires Python >= 3.12. Older versions (3.10, 3.11) will fail due to
requires-pythonconstraint. - Windows: Terminal color codes use
coloramawhich auto-initializes;os.system("cls")is used for screen clearing on Windows. - Cache directory: The
./cache/directory is created relative to the working directory; ensure write permissions.
Related Pages
- Implementation:51bitquant_Ai_hedge_fund_crypto_load_settings
- Implementation:51bitquant_Ai_hedge_fund_crypto_Workflow_create_workflow
- Implementation:51bitquant_Ai_hedge_fund_crypto_MacdStrategy_call
- Implementation:51bitquant_Ai_hedge_fund_crypto_Technical_Indicators
- Implementation:51bitquant_Ai_hedge_fund_crypto_weighted_signal_combination
- Implementation:51bitquant_Ai_hedge_fund_crypto_RiskManagementNode_call
- Implementation:51bitquant_Ai_hedge_fund_crypto_BaseNode_call
- Implementation:51bitquant_Ai_hedge_fund_crypto_MyStrategy_call
- Implementation:51bitquant_Ai_hedge_fund_crypto_import_strategy_class
- Implementation:51bitquant_Ai_hedge_fund_crypto_Backtester_execute_trade
- Implementation:51bitquant_Ai_hedge_fund_crypto_Backtester_calculate_portfolio_value
- Implementation:51bitquant_Ai_hedge_fund_crypto_Backtester_update_performance_metrics
- Implementation:51bitquant_Ai_hedge_fund_crypto_Backtester_analyze_performance
- Implementation:51bitquant_Ai_hedge_fund_crypto_DepthCache
- Implementation:51bitquant_Ai_hedge_fund_crypto_BinanceSocketManager
- Implementation:51bitquant_Ai_hedge_fund_crypto_Binance_Helpers
- Implementation:51bitquant_Ai_hedge_fund_crypto_KeepAliveWebsocket
- Implementation:51bitquant_Ai_hedge_fund_crypto_ReconnectingWebsocket
- Implementation:51bitquant_Ai_hedge_fund_crypto_ThreadedApiManager
- Implementation:51bitquant_Ai_hedge_fund_crypto_WebsocketAPI