microsoft / microsoft/vscode-python-environments

Feature Request: Easily Add Folder to PYTHONPATH from VS Code UI

Abierto
#735 5 comentarios 16 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

feature-request needs community feedback
Lenguaje dominante
TypeScript
Estrellas
138
Forks
62
Merge medio
1 d 4 h
PR fusionados (30 d)
35

Descripción

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.extraPaths setting only affects IntelliSense, not the runtime PYTHONPATH.
  • Using a .env file with PYTHONPATH=path1;path2;path3 is unreliable (in my experience) and not user-friendly.
  • Creating a .pth file 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 .pth method.)

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!

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

El issue no indica archivos, pruebas ni puntos de entrada de implementación; empieza por determinar si esto corresponde a vscode-python o vscode-python-environments y revisa la UI existente de entornos y el registro de comandos. Para darlo por terminado, sería necesario haber decidido el alcance y disponer de una forma visible para el usuario de añadir una carpeta seleccionada a la ruta de Python del entorno virtual seleccionado actualmente.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python, vscode
Área
developer-experience, tooling
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.