microsoft / microsoft/vscode-python-environments
Feature Request: Easily Add Folder to PYTHONPATH from VS Code UI
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 138
- Forks
- 62
- Ø Merge
- 1 T. 4 Std.
- Gemergte PRs (30 T.)
- 35
Beschreibung
Hi, I’m not sure if this belongs here or in vscode-python, but I’d like to request a more user-friendly way to add folders to the Python path in VS Code.
Current Situation
- The
python.analysis.extraPathssetting only affects IntelliSense, not the runtimePYTHONPATH. - Using a
.envfile withPYTHONPATH=path1;path2;path3is unreliable (in my experience) and not user-friendly. - Creating a
.pthfile in.venv/Lib/site-packages/as below works, but is also tedious and not user-friendly.
path1/src/
path2/src/
...
Feature Proposal
It would be very helpful to have:
- A context menu command when right-clicking a folder (e.g., “Add to Python Path”)
- An accessible command in the Command Palette (
Ctrl+Shift+P) - A button in the python-environments extension UI (it would be very intuitive to have a small icon/button next to each venv in the list. Clicking this button could prompt the user to select a folder, and then automatically add that folder to the venv using the
.pthmethod.)
This should add the folder to the Python path of the currently selected virtual environment in VS Code.
This would make managing the Python path much easier, especially for users coming from PyCharm, where this is a standard feature.
Thanks!
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
In diesem Issue werden keine Dateien, Tests oder Einstiegspunkte für die Implementierung genannt; ermittle zunächst, ob dies in vscode-python oder vscode-python-environments gehört, und prüfe die bestehende UI für Umgebungen sowie die Registrierung der Befehle. Als erledigt gilt die Aufgabe, wenn der Umfang festgelegt ist und es eine für Benutzer sichtbare Möglichkeit gibt, einen ausgewählten Ordner zum Python-Pfad der aktuell ausgewählten virtuellen Umgebung hinzuzufügen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python, vscode
- Bereich
- developer-experience, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100