From 9320b7973059fd08d34904b17b645271cd95fca2 Mon Sep 17 00:00:00 2001 From: crypto_predictor Date: Sat, 7 Feb 2026 22:26:07 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=96=B0=E6=95=B4?= =?UTF-8?q?=E7=90=86=20requirements.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要更改: - 修正 TTM 模型包名: tsfm_public -> granite-tsfm - 添加缺失依赖: httpx, schedule, pytorch-lightning, torchmetrics - 移除过时依赖: darts, u8darts - 按功能分类组织依赖 - 添加 Windows/macOS 安装说明注释 - 更新安装脚本和文档中的包名 --- docs/WINDOWS_INSTALL.md | 9 ++-- install_windows.bat | 4 +- requirements.txt | 94 ++++++++++++++++++++++++++++++----------- 3 files changed, 76 insertions(+), 31 deletions(-) diff --git a/docs/WINDOWS_INSTALL.md b/docs/WINDOWS_INSTALL.md index 039e551..b7afe76 100644 --- a/docs/WINDOWS_INSTALL.md +++ b/docs/WINDOWS_INSTALL.md @@ -94,14 +94,13 @@ pip install -r requirements.txt ### 3. 安装 IBM 时序模型 (TTM-R2) ```powershell -# 注意:PyPI 包名是 tsfm-public(带连字符),但导入时用 tsfm_public(下划线) -pip install tsfm-public +# PyPI 包名是 granite-tsfm,导入时用 tsfm_public +pip install granite-tsfm ``` -如果安装失败,尝试: +验证安装: ```powershell -# 从 GitHub 安装 -pip install git+https://github.com/ibm-granite/granite-tsfm.git +python -c "from tsfm_public.models.tinytimemixer import TinyTimeMixerForPrediction; print('TTM-R2 安装成功')" ``` --- diff --git a/install_windows.bat b/install_windows.bat index bfe958f..fecd283 100644 --- a/install_windows.bat +++ b/install_windows.bat @@ -39,8 +39,8 @@ pip install -r requirements.txt echo. echo [5/6] 安装 IBM TTM-R2 模型库... -echo 注意: tsfm-public 包名使用连字符 -pip install tsfm-public +echo 包名: granite-tsfm (导入时用 tsfm_public) +pip install granite-tsfm echo. echo [6/6] 验证安装... diff --git a/requirements.txt b/requirements.txt index 33c8eb3..8f4c3b1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,45 +1,91 @@ -# Core dependencies +# ============================================== +# 加密货币预测系统依赖 +# Python 3.12 | 支持 macOS (MPS) 和 Windows (CPU) +# ============================================== + +# ---------------------------------------------- +# PyTorch (根据平台安装) +# ---------------------------------------------- +# macOS: pip install torch torchvision torchaudio +# Windows CPU: pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu torch>=2.0.0 -torchvision -torchaudio -python-binance>=1.0.19 +torchvision>=0.15.0 +torchaudio>=2.0.0 +pytorch-lightning>=2.0.0 +torchmetrics>=1.0.0 + +# ---------------------------------------------- +# 数据处理 +# ---------------------------------------------- pandas>=2.0.0 numpy>=1.24.0 scikit-learn>=1.3.0 pytz -python-dotenv>=1.0.0 -# ONNX +# ---------------------------------------------- +# 时序模型 +# ---------------------------------------------- +# IBM Granite TTM-R2 (PyPI 包名: granite-tsfm) +granite-tsfm>=0.3.0 +# GluonTS 时序工具 +gluonts[torch]>=0.14.0 + +# ---------------------------------------------- +# 技术指标 +# ---------------------------------------------- +pandas-ta>=0.3.14b + +# ---------------------------------------------- +# ONNX 模型导出 +# ---------------------------------------------- onnx>=1.14.0 onnxruntime>=1.15.0 -# Model-specific dependencies -darts>=0.27.0 -u8darts[torch]>=0.27.0 -tsfm_public>=0.2.0 -gluonts[torch]>=0.14.0 - -# API dependencies +# ---------------------------------------------- +# API 服务 +# ---------------------------------------------- fastapi>=0.104.0 uvicorn[standard]>=0.24.0 pydantic>=2.0.0 python-multipart>=0.0.6 -# Technical indicators -pandas-ta>=0.3.14b +# ---------------------------------------------- +# HTTP 客户端 +# ---------------------------------------------- +httpx>=0.25.0 -# Development tools +# ---------------------------------------------- +# 数据源 +# ---------------------------------------------- +python-binance>=1.0.19 + +# ---------------------------------------------- +# 任务调度 +# ---------------------------------------------- +schedule>=1.2.0 + +# ---------------------------------------------- +# 数据库 +# ---------------------------------------------- +pymysql>=1.1.0 +sqlalchemy>=2.0.0 +cryptography>=41.0.0 + +# ---------------------------------------------- +# 环境变量 +# ---------------------------------------------- +python-dotenv>=1.0.0 + +# ---------------------------------------------- +# 开发工具 (可选) +# ---------------------------------------------- jupyter>=1.0.0 matplotlib>=3.7.0 seaborn>=0.12.0 pytest>=7.4.0 -black>=23.0.0 -flake8>=6.0.0 - -# Utilities tqdm>=4.66.0 -# Database -pymysql>=1.1.0 -sqlalchemy>=2.0.0 -cryptography>=41.0.0 +# ---------------------------------------------- +# Polymarket 交易 (可选,需要手动安装) +# ---------------------------------------------- +# pip install py-clob-client