- Implement dynamic stock universe with 3-stage filtering (liquidity, fundamentals, technicals) - Create Claude + Qwen3 AI collaboration service for intelligent stock analysis - Update recommendation routes to use live market data instead of hard-coded lists - Add new documentation and deployment scripts - Update Docker configuration for AI model integration BREAKING CHANGE: Replaces hard-coded stock recommendations with dynamic market-based filtering Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
87 lines
1.9 KiB
Bash
Executable File
87 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# 快速修复 pydantic_settings 问题
|
|
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m'
|
|
|
|
echo -e "${YELLOW}🔧 Quick Fix for pydantic_settings${NC}"
|
|
echo ""
|
|
|
|
# 1. 检查虚拟环境
|
|
if [ ! -d "backend/.venv" ]; then
|
|
echo -e "${RED}✗ Virtual environment not found${NC}"
|
|
echo "Run: ./start_app.sh to create it"
|
|
exit 1
|
|
fi
|
|
|
|
# 2. 激活并安装
|
|
echo "Activating virtual environment..."
|
|
source backend/.venv/bin/activate
|
|
|
|
echo "Installing core packages..."
|
|
pip install --upgrade pip setuptools wheel -q
|
|
|
|
# 关键:单独安装每个包并验证
|
|
packages=(
|
|
"pydantic==2.5.0"
|
|
"pydantic-settings==2.1.0"
|
|
"python-dotenv==1.0.0"
|
|
)
|
|
|
|
for pkg in "${packages[@]}"; do
|
|
echo -n "Installing $pkg... "
|
|
if pip install "$pkg" 2>&1 | grep -q "Successfully installed\|already satisfied"; then
|
|
echo -e "${GREEN}✓${NC}"
|
|
else
|
|
echo -e "${RED}✗${NC}"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
# 3. 验证导入
|
|
echo ""
|
|
echo "Verifying imports..."
|
|
python << 'PYEOF'
|
|
try:
|
|
import pydantic
|
|
print("✓ pydantic:", pydantic.__version__)
|
|
except ImportError as e:
|
|
print("✗ pydantic:", e)
|
|
exit(1)
|
|
|
|
try:
|
|
import pydantic_settings
|
|
print("✓ pydantic_settings:", pydantic_settings.__version__)
|
|
except ImportError as e:
|
|
print("✗ pydantic_settings:", e)
|
|
exit(1)
|
|
|
|
try:
|
|
from pydantic_settings import BaseSettings
|
|
print("✓ BaseSettings import works")
|
|
except ImportError as e:
|
|
print("✗ BaseSettings:", e)
|
|
exit(1)
|
|
|
|
print("\n✓ All imports successful!")
|
|
PYEOF
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo ""
|
|
echo -e "${GREEN}✓ Fix complete!${NC}"
|
|
echo ""
|
|
echo "You can now run:"
|
|
echo " ./start_app.sh"
|
|
else
|
|
echo ""
|
|
echo -e "${RED}✗ Fix failed${NC}"
|
|
echo ""
|
|
echo "Try rebuilding the virtual environment:"
|
|
echo " rm -rf backend/.venv"
|
|
echo " ./start_app.sh"
|
|
exit 1
|
|
fi
|