EG/requirements/DEPLOYMENT_README.md
2025-12-12 16:16:15 +08:00

90 lines
2.0 KiB
Markdown
Raw 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.

# 项目部署指南
## 🚀 在新电脑上运行此项目
### 方法1使用Conda推荐
```bash
# 1. 安装Miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
# 2. 克隆项目
git clone <your-repo-url>
cd eg
# 3. 创建conda环境
conda env create -f environment.yml
# 4. 激活环境
conda activate eg-project
# 5. 运行项目
python main.py
```
### 方法2使用virtualenv + pip
```bash
# 1. 克隆项目
git clone <your-repo-url>
cd eg
# 2. 创建虚拟环境
python -m venv venv
source venv/bin/activate # Linux/Mac
# 或 venv\Scripts\activate # Windows
# 3. 安装依赖
pip install -r clean-requirements.txt
# 4. 运行项目
python main.py
```
## 📁 需要复制的文件
**必须复制:**
- `main.py` - 主程序
- `gui_preview_window.py` - GUI窗口
- `demo/` - 演示文件夹
- `environment.yml` - Conda环境配置
- `clean-requirements.txt` - 核心依赖
**不要复制:**
- `.conda/` - 虚拟环境文件夹
- `__pycache__/` - Python缓存
- `requirements.txt` - 包含系统包的混乱依赖
## 🔧 Cursor IDE 设置
1. **打开项目**在Cursor中打开项目文件夹
2. **选择解释器**
- `Ctrl+Shift+P` → "Python: Select Interpreter"
- 选择虚拟环境中的Python路径
3. **验证环境**检查状态栏显示正确的Python版本
## 📦 项目依赖说明
- **Panda3D**: 3D图形引擎
- **PyQt5/PySide6**: GUI框架
- **Pillow**: 图像处理
- **python-dotenv**: 环境变量管理
- **pyassimp**: 3D模型加载
## 🌍 跨平台注意事项
- Linux/Mac: 使用 `source venv/bin/activate`
- Windows: 使用 `venv\Scripts\activate`
- 某些依赖可能需要系统级安装如OpenGL库
## 🐛 常见问题
**Q: 无法安装Panda3D**
A: 确保系统有OpenGL支持或使用conda安装
**Q: PyQt5无法运行**
A: 可能需要安装系统级GUI依赖
**Q: 导入错误?**
A: 检查Python版本需要3.10+