Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a selected global python interpreter on to PATH #13327

Closed
ditordccaa opened this issue Aug 6, 2020 · 6 comments
Closed

Add a selected global python interpreter on to PATH #13327

ditordccaa opened this issue Aug 6, 2020 · 6 comments
Assignees
Labels
area-terminal feature-request Request for new features or functionality

Comments

@ditordccaa
Copy link

Environment data

  • VS Code version: 1.47.3
  • Extension version (available under the Extensions sidebar): XXX
  • OS and version: Windows Server 2019
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.8 and Python 3.8.4 (downloaded from Python.org)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): NA
  • Relevant/affected Python packages and their versions:
  • Relevant/affected Python-related VS Code extensions and their versions: Python 2020.7.96456 and Shell launcher 0.4.1
  • Value of the python.languageServer setting: None

Expected behaviour

When I select the Python Interpreter version, I expect to get the selected version in the VSC integrated terminal.

Actual behaviour

When I type Python in the integrated terminal, the command is not recognized.
In my user settings, I'm setting the PATH environment variable (I removed the path for the python directory here). Also I'm excluding myself from the A/B pythonPath testing.

Steps to reproduce:

Python-Interpreter

Logs

Output from Python output channel

> conda --version
> pyenv root
> python3.7 c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.7 c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.6 c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3 c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -2 c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> ~\AppData\Local\Programs\Python\Python38\python.exe c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> ~\anaconda3\Scripts\conda.exe info --json
Starting Pylance language server.
Python interpreter path: ~\AppData\Local\Programs\Python\Python38\python.exe
Error 2020-08-06 14:59:13: Attempted to download with skipDownload true.
> ~\AppData\Local\Programs\Python\Python38\python.exe c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import jupyter"
> ~\AppData\Local\Programs\Python\Python38\python.exe c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import jupyter"
> ~\AppData\Local\Programs\Python\Python38\python.exe c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import notebook"
> ~\AppData\Local\Programs\Python\Python38\python.exe c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py -c "import notebook"
Error 2020-08-06 14:59:16: Detection of Python Interpreter for Command py and args -2 failed as file Python 2 not found!

 -3.8-64
 -3.7-64 does not exist
Error 2020-08-06 14:59:16: Detection of Python Interpreter for Command py and args -3.6 failed as file Python 3.6 not found!

 -3.8-64
 -3.7-64 does not exist
> ~\anaconda3\Scripts\conda.exe info --json
> ~\anaconda3\Scripts\conda.exe env list
> ~\AppData\Local\Programs\Python\Python37\python.exe c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py pip --version
Python interpreter path: ~\AppData\Local\Programs\Python\Python37\python.exe
> ~\AppData\Local\Programs\Python\Python38\python.exe c:\Users\el.mehdi.el.aouni\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\pyvsc-run-isolated.py pip --version
Editor support is inactive since language server is set to None.
Python interpreter path: ~\AppData\Local\Programs\Python\Python38\python.exe

@ditordccaa ditordccaa added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Aug 6, 2020
@brettcannon
Copy link
Member

We do not participate in the terminal creation in terms of PATH. I also don't see any entry in your custom PATH setting that would place a python binary on your PATH. If you used the Python installer from python.org then you need to explicitly opt into putting Python on to the PATH to begin with.

What I will do, though, is turn this into a feature request to try to come up with a way to include a global Python interpreter into the terminal when one is manually specified.

@brettcannon brettcannon changed the title Python is not recognized in the VSC integrated terminal Add a selected global python interpreter on to PATH Aug 10, 2020
@brettcannon brettcannon added area-terminal needs decision feature-request Request for new features or functionality and removed triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Aug 10, 2020
@ditordccaa
Copy link
Author

Perfect. Makes sense. Thank you @brettcannon

@ghost ghost removed the needs decision label Aug 10, 2020
@brettcannon brettcannon reopened this Aug 11, 2020
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Aug 11, 2020
@brettcannon
Copy link
Member

@ditordccaa I'm reopening this to leave it as a feature request. If you aren't interested in it you can unsubscribe from the issue if you prefer.

@karthiknadig karthiknadig added needs decision and removed triage-needed Needs assignment to the proper sub-team labels Aug 11, 2020
@luabud
Copy link
Member

luabud commented Sep 23, 2020

We will want to address after #11039.

@karrtikr
Copy link

@luabud Should we close this as we're deciding to not do it right now?

cc/ @brettcannon

@brettcannon
Copy link
Member

We are afraid of breaking users if we were to implement this. Plus, we would rather encourage people to use environments which do have shell activation support.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2023
@github-actions github-actions bot removed the needs proposal Need to make some design decisions label Dec 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-terminal feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants