ai-business-write/setup_env.sh
2025-12-04 14:41:20 +08:00

24 lines
498 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 创建虚拟环境并安装依赖Linux/Mac
echo "创建Python虚拟环境..."
python3 -m venv venv
echo "激活虚拟环境..."
source venv/bin/activate
echo "安装依赖..."
pip install -r requirements.txt
echo "复制环境变量配置文件..."
if [ ! -f .env ]; then
cp .env.example .env
echo "请编辑 .env 文件填入你的API密钥"
fi
echo "完成!"
echo "使用以下命令启动服务:"
echo " source venv/bin/activate"
echo " python app.py"