更新文档:移除 yfinance 依赖,说明使用腾讯财经数据源

This commit is contained in:
黑猴
2026-03-30 22:16:33 +08:00
parent 46f06fc967
commit ef3f4684ea
2 changed files with 12 additions and 12 deletions

View File

@@ -5,33 +5,33 @@
echo "正在安装港股分析工具依赖..."
# 检查是否已安装
python3 -c "import yfinance; import numpy; import pandas; print('依赖已安装')" 2>/dev/null
python3 -c "import numpy; import pandas; print('依赖已安装')" 2>/dev/null
if [ $? -eq 0 ]; then
echo "✅ 所有依赖已就绪"
exit 0
fi
# 尝试安装 (兼容 PEP 668 限制)
pip3 install yfinance numpy pandas --quiet 2>/dev/null
pip3 install numpy pandas --quiet 2>/dev/null
if [ $? -ne 0 ]; then
echo "尝试使用 --break-system-packages 安装..."
pip3 install --break-system-packages yfinance numpy pandas --quiet 2>/dev/null
pip3 install --break-system-packages numpy pandas --quiet 2>/dev/null
fi
if [ $? -ne 0 ]; then
echo "尝试使用 --user 安装..."
pip3 install --user yfinance numpy pandas --quiet 2>/dev/null
pip3 install --user numpy pandas --quiet 2>/dev/null
fi
# 最终验证
python3 -c "import yfinance; import numpy; import pandas" 2>/dev/null
python3 -c "import numpy; import pandas" 2>/dev/null
if [ $? -eq 0 ]; then
echo "✅ 依赖安装成功"
echo "已安装: yfinance, numpy, pandas"
echo "已安装: numpy, pandas"
else
echo "❌ 安装失败,请手动运行以下命令之一:"
echo " pip3 install yfinance numpy pandas"
echo " pip3 install --break-system-packages yfinance numpy pandas"
echo " pip3 install --user yfinance numpy pandas"
echo " pip3 install numpy pandas"
echo " pip3 install --break-system-packages numpy pandas"
echo " pip3 install --user numpy pandas"
exit 1
fi