Select pyenv environment based on folder .python-version file · Issue #1167 · microsoft/vscode-python (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
Environment data
- VS Code version: 1.21.1
- Extension version (available under the Extensions sidebar): 2018.2.1
- OS and version: macOS 10.13.3
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.4
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pyenv
- Relevant/affected Python packages and their versions: pyenv 1.2.1
Actual behavior
You have to manually select the pyenv interpreter for each workspace folder.
Expected behavior
It should detect the workspace pyenv interpreter based on the .python-version
file present in the workspace folder root.
For example, every folder I have added to my workspace has a .python-version
file that pyenv creates when you run pyenv local NAME_OF_VENV
in that folder. The file contains a single string which is the name of the folder/symlink in ~/.pyenv/versions/
that should be used.