From 9ee0b1b88a03d752160dd427e9bc993701d73a1e Mon Sep 17 00:00:00 2001 From: aaron <> Date: Mon, 28 Apr 2025 16:41:52 +0800 Subject: [PATCH] update --- qinglong_task.sh | 30 ++++++++++++++++++++++++++++-- requirements.txt | 16 +++++++++------- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/qinglong_task.sh b/qinglong_task.sh index 1fc57b7..48efa6d 100755 --- a/qinglong_task.sh +++ b/qinglong_task.sh @@ -58,10 +58,36 @@ if [ -d "/ql/data/scripts/cryptoai/venv" ]; then source /ql/data/scripts/cryptoai/venv/bin/activate fi +# 安装编译工具 +echo "检查编译工具..." +if ! command -v gcc &> /dev/null; then + echo "安装基本编译工具..." + if command -v apk &> /dev/null; then + # Alpine Linux + apk add --no-cache gcc g++ musl-dev python3-dev + elif command -v apt-get &> /dev/null; then + # Debian/Ubuntu + apt-get update && apt-get install -y build-essential python3-dev + elif command -v yum &> /dev/null; then + # CentOS/RHEL + yum install -y gcc gcc-c++ python3-devel + fi +fi + # 检查依赖是否安装 -if ! pip list | grep -q "sqlalchemy"; then +if ! pip list | grep -q "pandas"; then echo "安装依赖..." - pip install -r requirements.txt + # 使用国内镜像源并优先使用预编译的wheel + pip install -i https://mirrors.aliyun.com/pypi/simple/ --prefer-binary python-binance==1.0.16 + pip install -i https://mirrors.aliyun.com/pypi/simple/ --prefer-binary pandas==2.0.3 + pip install -i https://mirrors.aliyun.com/pypi/simple/ --prefer-binary numpy==1.24.3 + pip install -i https://mirrors.aliyun.com/pypi/simple/ --prefer-binary matplotlib==3.7.1 + pip install -i https://mirrors.aliyun.com/pypi/simple/ --prefer-binary scikit-learn==1.2.2 + pip install -i https://mirrors.aliyun.com/pypi/simple/ --prefer-binary sqlalchemy==2.0.19 + pip install -i https://mirrors.aliyun.com/pypi/simple/ --prefer-binary pymysql==1.1.0 + pip install -i https://mirrors.aliyun.com/pypi/simple/ --prefer-binary cryptography==41.0.3 + pip install -i https://mirrors.aliyun.com/pypi/simple/ --prefer-binary requests==2.31.0 + pip install -i https://mirrors.aliyun.com/pypi/simple/ --prefer-binary pyyaml==6.0.1 fi # 运行加密货币分析 diff --git a/requirements.txt b/requirements.txt index 973c669..2fff62c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,16 +1,18 @@ python-binance==1.0.16 -pandas>=2.0.0 -numpy>=2.0.0 -matplotlib>=3.7.0 -scikit-learn>=1.3.0 -requests>=2.31.0 +pandas==2.0.3 +numpy==1.24.3 +matplotlib==3.7.1 +scikit-learn==1.2.2 +sqlalchemy==2.0.19 +pymysql==1.1.0 +cryptography==41.0.3 +requests==2.31.0 +pyyaml==6.0.1 python-dotenv==1.0.0 deepseek-ai==0.0.1 -pyyaml==6.0.1 schedule==1.2.0 aiohttp>=3.8.5 langchain>=0.0.267 pydantic>=2.3.0 fastapi>=0.103.1 uvicorn>=0.23.2 -sqlalchemy==2.0.31