You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+79Lines changed: 79 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,85 @@ This project will be consumed by the [Python extension](https://marketplace.visu
31
31
32
32
Our approach prioritizes performance and efficiency by leveraging Rust. We minimize I/O operations by collecting all necessary environment information at once, which reduces repeated I/O and the need to spawn additional processes, significantly enhancing overall performance.
33
33
34
+
## Debugging Python Environment Issues
35
+
36
+
If you're experiencing issues with Python interpreter detection in VS Code (such as the Run button not working, Python not being recognized, or interpreters not persisting), you can use PET to diagnose the problem.
37
+
38
+
### Running PET for Debugging
39
+
40
+
PET can be run directly from the command line to discover all Python environments on your system. This helps identify whether the issue is with environment discovery or elsewhere.
41
+
42
+
#### Quick Start
43
+
44
+
1.**Download or build PET**:
45
+
- Download pre-built binaries from the [releases page](https://github.com/microsoft/python-environment-tools/releases)
46
+
- Or build from source: `cargo build --release`
47
+
48
+
2.**Run PET to find all environments**:
49
+
```bash
50
+
# On Linux/macOS
51
+
./pet find --list --verbose
52
+
53
+
# On Windows
54
+
pet.exe find --list --verbose
55
+
```
56
+
57
+
3.**Share the output** with maintainers when reporting issues
58
+
59
+
#### Common Commands
60
+
61
+
-**Find all Python environments** (default behavior):
62
+
```bash
63
+
pet
64
+
```
65
+
66
+
-**Find all environments with detailed logging**:
67
+
```bash
68
+
pet find --list --verbose
69
+
```
70
+
71
+
-**Search only in workspace/project directories**:
72
+
```bash
73
+
pet find --list --workspace
74
+
```
75
+
76
+
-**Search for a specific environment type** (e.g., Conda):
77
+
```bash
78
+
pet find --list --kind conda
79
+
```
80
+
81
+
-**Resolve a specific Python executable**:
82
+
```bash
83
+
pet resolve /path/to/python
84
+
```
85
+
86
+
#### Understanding the Output
87
+
88
+
The output includes:
89
+
90
+
-**Discovered Environments**: List of Python installations found, including:
91
+
- Type (Conda, Venv, System Python, etc.)
92
+
- Executable path
93
+
- Version
94
+
- Prefix (sys.prefix)
95
+
- Architecture (x64/x86)
96
+
- Symlinks
97
+
98
+
-**Timing Information**: How long each locator took to search
99
+
100
+
-**Summary Statistics**: Count of environments by type
101
+
102
+
#### Reporting Issues
103
+
104
+
When reporting Python detection issues, please include:
105
+
106
+
1. The full output from running `pet find --list --verbose`
107
+
2. Your operating system and version
108
+
3. VS Code and Python extension versions
109
+
4. Description of the issue
110
+
111
+
This information helps maintainers diagnose whether the problem is with PET's discovery logic or elsewhere in the VS Code Python extension.
112
+
34
113
## Contributing
35
114
36
115
This project welcomes contributions and suggestions. Most contributions require you to agree to a
0 commit comments