[feature request] get python.pythonPath from cwd rather than system wide.
See original GitHub issueEnvironment data
VS Code version: 1.8.1 Python Extension version: 0.8.0 Python Version: 3.6.3 OS and version: macOS 10.13.2
Actual behavior
use system python
if I leave python.pythonPath
blank
Expected behavior
find python
at current path
use
python
set pypyenv
I can set.python-version
in some parent-folder
Steps to reproduce:
pyenv local <some-version>
at~/dev
- open
~/dev/project1
as a project - current
python.pythonPath
is the system-wide, not read from current folder.
Issue Analytics
- State:
- Created 6 years ago
- Comments:20 (5 by maintainers)
Top Results From Across the Web
4. Using Python on Windows — Python 3.11.1 documentation
This document aims to give an overview of Windows-specific behaviour you should know about when using Python on Microsoft Windows. Unlike most Unix...
Read more >Understanding the Python Path Environment Variable in Python
Pythonpath is a special environment variable that provides guidance to the Python interpreter about where to find various libraries and ...
Read more >How to Find Path Information in Python - Dummies.com
In this article, learn about the sources of path information in Python, and how to find path information using two different methods.
Read more >3. Using Python on Windows
Unlike the PATH variable, the launcher will correctly select the most appropriate version of Python. It will prefer per-user installations over system-wide ones ......
Read more >Install a Python package into a different directory using pip?
The --target switch is the thing you're looking for: pip install --target=d:\somewhere\other\than\the\default package_name.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gwax All of mine aren’t showing up, so I’m curious how you accomplished (or lucked into) that. I’d be fine with most of the issues you mention if I at least got a complete list, but look at this:
Now: Screenshot of
Python: Select Interpreter
Notice that the PonyGE2 and nrf venvs are nowhere to be seen. It’s almost like it’s taking the first one in order under the3.6.5
parent and ignoring the rest.pyenv
is a tool that replaces python and installed python tools (pylint
,flake8
, etc.) with symbolic links and routes requests to different commands based on global/local configuration.It is used as an alternative to virtualenvs and is one of the more common ways of managing python versions on OSX.
So, for example:
The crux of it is that executing a command from a given folder will result in pyenv routing it to the correct environment (assuming bash_profile/bashrc has been run and set up pyenv).
So, the ask (I think) is that when linting/executing/whatever a given source file, execute the command from the location of that file. Alternatively, the interpreter could be set by using
pyenv which python
for any given path.