|
1 | | -# 🎉 Python Environment Reset Tool v1.0.0 |
| 1 | +# 🎉 Python Environment Reset Tool v1.1.0 |
2 | 2 |
|
3 | | -> A lightweight Windows tool for safely resetting Python virtual environments |
| 3 | +> A lightweight Windows tool for safely resetting Python virtual environments with multi-version support |
4 | 4 |
|
5 | 5 | ## ✨ Highlights |
6 | 6 |
|
7 | | -🔍 **Smart Detection** - Automatically finds and activates your virtual environment |
8 | | -🛡️ **Safety First** - Strong warnings and confirmations before any changes |
9 | | -📦 **Complete Reset** - Clean uninstall of all packages + fresh base installation |
10 | | -🌐 **UTF-8 Support** - Perfect handling of Chinese and international characters |
| 7 | +🔍 **Smart Detection** - Automatically finds and activates your virtual environment |
| 8 | +🐍 **Multi-Version Support** - Detects all Python installations and lets you choose (NEW!) |
| 9 | +🛡️ **Safety First** - Strong warnings and confirmations before any changes |
| 10 | +📦 **Complete Reset** - Clean uninstall of all packages + fresh base installation |
| 11 | +🌐 **UTF-8 Support** - Perfect handling of Chinese and international characters |
11 | 12 |
|
12 | 13 | ## 🚀 Quick Start |
13 | 14 |
|
|
16 | 17 | 3. Double-click to run |
17 | 18 | 4. Follow the prompts |
18 | 19 |
|
19 | | -## 📦 What's New |
| 20 | +## 📦 What's New in v1.1.0 |
20 | 21 |
|
21 | | -This is the **initial stable release** featuring: |
| 22 | +### 🆕 Major Feature: Multi-Python Version Detection |
22 | 23 |
|
23 | | -- ✅ Automatic virtual environment detection (`.venv`, `venv`, `env`, `.env`) |
24 | | -- ✅ Safe package uninstallation with confirmation |
25 | | -- ✅ Automatic pip upgrade |
26 | | -- ✅ Base packages installation (setuptools, wheel) |
27 | | -- ✅ Clear console interface with progress indicators |
28 | | -- ✅ Error handling and helpful hints |
| 24 | +When operating on the global environment, the tool now: |
| 25 | + |
| 26 | +- ✨ **Auto-detects all Python installations** using both `where python` and Python Launcher (`py -0p`) |
| 27 | +- 🎯 **Smart selection**: Auto-uses the only version if just one is found |
| 28 | +- 📋 **Interactive choice**: Shows a numbered list when multiple versions exist |
| 29 | +- ✅ **Input validation**: Ensures you pick a valid version number |
| 30 | +- 🔒 **Precise control**: Reset only the Python version you actually want |
| 31 | + |
| 32 | +### 🔧 Technical Improvements |
| 33 | + |
| 34 | +- All pip operations now use `python -m pip` for version-specific execution |
| 35 | +- Enhanced script reliability with delayed variable expansion |
| 36 | +- Automatic deduplication of detected Python paths |
| 37 | +- Improved error handling throughout the script |
| 38 | + |
| 39 | +### 📈 Growth |
| 40 | + |
| 41 | +- Script expanded from 197 to 333 lines (+68% for better functionality) |
| 42 | +- Added comprehensive documentation in CLAUDE.md |
| 43 | +- Updated bilingual README with detailed usage scenarios |
29 | 44 |
|
30 | 45 | ## 💡 Perfect For |
31 | 46 |
|
32 | 47 | - Cleaning up messy virtual environments |
33 | | -- Troubleshooting package conflicts |
| 48 | +- Managing multiple Python versions on your system |
| 49 | +- Troubleshooting package conflicts |
34 | 50 | - Starting fresh without recreating venv |
35 | | -- Testing clean installations |
| 51 | +- Testing clean installations across different Python versions |
36 | 52 |
|
37 | 53 | ## ⚠️ Safety Features |
38 | 54 |
|
39 | 55 | - **Global environment protection** - Requires typing `YES` to operate on system Python |
| 56 | +- **Version confirmation** - Shows selected Python path and version before proceeding |
40 | 57 | - **Multiple confirmations** - Shows package list before uninstalling |
41 | 58 | - **Non-destructive** - Doesn't delete the venv folder itself |
42 | 59 |
|
| 60 | +## 📖 Example Workflow |
| 61 | + |
| 62 | +### With Virtual Environment (Unchanged) |
| 63 | +```batch |
| 64 | +# Your venv is detected automatically |
| 65 | +> env-reset.bat |
| 66 | +检测到虚拟环境: .venv |
| 67 | +当前 Python 环境: C:\Project\.venv\Scripts\python.exe |
| 68 | +# Continues normally... |
| 69 | +``` |
| 70 | + |
| 71 | +### With Multiple Python Versions (NEW!) |
| 72 | +```batch |
| 73 | +> env-reset.bat |
| 74 | +# No venv detected, shows warning |
| 75 | +真的要操作全局环境吗?(输入大写 YES 确认): YES |
| 76 | +
|
| 77 | +检测到以下 Python 版本: |
| 78 | +------------------------------------------ |
| 79 | +[1] C:\Users\User\AppData\Local\Programs\Python\Python312\python.exe |
| 80 | + Python 3.12.0 |
| 81 | +[2] C:\Users\User\AppData\Local\Programs\Python\Python311\python.exe |
| 82 | + Python 3.11.5 |
| 83 | +------------------------------------------ |
| 84 | +
|
| 85 | +请选择 Python 版本 [1-2]: 1 |
| 86 | +
|
| 87 | +已选择: C:\Users\User\AppData\Local\Programs\Python\Python312\python.exe |
| 88 | +Python 3.12.0 |
| 89 | +# Continues with selected version... |
| 90 | +``` |
| 91 | + |
43 | 92 | ## 📖 Documentation |
44 | 93 |
|
45 | 94 | Full documentation available in [README.md](README.md) with both English and Chinese versions. |
46 | 95 |
|
| 96 | +See [CHANGELOG.md](CHANGELOG.md) for complete version history. |
| 97 | + |
47 | 98 | ## 🤝 Contributing |
48 | 99 |
|
49 | 100 | Issues, feature requests, and pull requests are welcome! |
|
0 commit comments