Skip to main content

一键配置机器学习/深度学习环境,解决依赖冲突和配置难题

Project description

ML Easy Setup

一键配置机器学习/深度学习环境,让科研工作更专注于算法本身

Python Version License Code style: black

🚀 为什么选择 ML Easy Setup?

痛点:配置 ML/DL 环境总是遇到各种问题

  • ❌ PyTorch、TensorFlow 版本冲突
  • ❌ CUDA 驱动与工具包不匹配
  • ❌ 依赖关系复杂,小白不知道从何入手
  • ❌ 每次换电脑都要重新配置半天

解决方案:一条命令搞定一切

  • ✅ 自动检测硬件和 CUDA 版本
  • ✅ 预配置最佳实践的环境模板
  • ✅ 基于 uv 的高速包安装
  • ✅ 完善的依赖冲突检测

📦 安装

pip install ml-easy-setup

或使用 uv(更快):

uv pip install ml-easy-setup

🎯 快速开始

创建一个新的 PyTorch 项目

# 自动检测 CUDA 版本并创建环境
mlsetup create my-project --template pytorch --cuda auto

cd my-project
source .venv/bin/activate  # Linux/Mac
# 或
.venv\Scripts\activate     # Windows

创建 NLP 研究环境

mlsetup create nlp-research --template nlp --cuda auto

创建 CPU 版本环境

mlsetup create ml-experiment --template minimal --cuda cpu

📋 可用模板

模板 描述 核心库
minimal 最小化配置,仅包含基础 ML 库 numpy, pandas, scikit-learn
pytorch PyTorch 深度学习框架 torch, torchvision, torchaudio
tensorflow TensorFlow 深度学习框架 tensorflow, keras
nlp 自然语言处理环境 torch, transformers, datasets
cv 计算机视觉环境 torch, torchvision, opencv-python
rl 强化学习环境 torch, gymnasium, stable-baselines3

查看所有模板

mlsetup list-templates

🔧 系统检测

检查您的系统环境:

mlsetup detect

输出示例:

系统环境检测
━━━━━━━━━━━━━━━━━━━━━━━━━━━
项目          检测结果
━━━━━━━━━━━━━━━━━━━━━━━━━━━
操作系统      Darwin
Python 版本   3.11.5
架构          arm64
CUDA          未安装
GPU           Apple Silicon (MPS)
UV            0.1.20
━━━━━━━━━━━━━━━━━━━━━━━━━━━

📦 添加额外的包

# 添加到核心依赖
mlsetup add numpy pandas

# 添加到开发依赖
mlsetup add pytest --dev

🏗️ 项目结构

创建的项目包含以下结构:

my-project/
├── .venv/              # 虚拟环境
├── src/                # 源代码目录
├── tests/              # 测试目录
├── data/               # 数据目录
├── notebooks/          # Jupyter notebooks
├── outputs/            # 输出文件目录
├── requirements.txt    # 核心依赖
├── requirements-dev.txt # 开发依赖
└── .gitignore          # Git 忽略文件

🎨 配置选项

CUDA 版本

支持以下 CUDA 版本:

  • auto - 自动检测(推荐)
  • cpu - 仅 CPU 版本
  • 11.8 - CUDA 11.8
  • 12.1 - CUDA 12.1
  • 12.4 - CUDA 12.4
  • none - 不安装 CUDA 相关包

Python 版本

mlsetup create my-project --python 3.11

支持的 Python 版本:3.10, 3.11, 3.12

🆚 与其他工具对比

特性 ML Easy Setup conda poetry venv
专为 ML 设计
自动 CUDA 检测
安装速度 ⚡⚡⚡ ⚡⚡
学习曲线
预配置模板

🔮 路线图

  • 支持 Docker 容器化环境
  • 环境导出/导入功能
  • 云端环境配置(AWS/GCP)
  • 图形化配置界面
  • 环境健康检查工具

🤝 贡献

欢迎贡献!请查看 CONTRIBUTING.md 了解详情。

📄 许可证

本项目采用 MIT 许可证 - 详见 LICENSE 文件。

🙏 致谢

  • uv - 高性能 Python 包管理器
  • click - 优雅的命令行界面
  • rich - 终端美化输出

⭐ 如果这个项目对您有帮助,请考虑给我们一个星标!

Made with ❤️ for the ML community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ml_easy_setup-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ml_easy_setup-0.1.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file ml_easy_setup-0.1.0.tar.gz.

File metadata

  • Download URL: ml_easy_setup-0.1.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ml_easy_setup-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8b715877c94d3edfa5061fe1ca654c0f06973828d886b63035a149a6983a1ed8
MD5 85a941a1b7f631c085e8535b01571247
BLAKE2b-256 01366838be2fa3f62015bee54b2c11c747220d1b40b0b398fc5cf705e2cb71bb

See more details on using hashes here.

File details

Details for the file ml_easy_setup-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ml_easy_setup-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ml_easy_setup-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7884c85cadddb4e5c5617703dd0b465b73942a63676495db30cf857c6a2178e8
MD5 3d46aed5179ad91223e391944f2bd082
BLAKE2b-256 948df7835753b429909f74fc94f32a9c0ca6956bff00d116812ea1b91bb93a85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page