question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python embedded install for Windows not being recognized

See original GitHub issue

I am having the same issue. Every time I press F5 to debug a python file, VS code asks me to select a python interpreter. When I press “python: select an interpreter”, it shows currently it has identified the one I installed. And I already have both “python.defaultInterpreterPath” and “python.pythonPath” configured in the settings.json.

Version: 1.44.2 (user setup) Commit: ff915844119ce9485abfe8aa9076ec76b5300ddd Date: 2020-04-16T16:36:23.138Z Electron: 7.1.11 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.17763

The python extension version is: 2020.4.74986

The python I am using is: python-3.8.2-embed-amd64

Do I have to use a x86 version python?

User belongs to experiment group 'AlwaysDisplayTestExplorer - experiment'
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - enabled'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - control'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'WebHostNotebook - control'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
> conda --version
> pyenv root
> python3.7 c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.7 c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.6 c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3 c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -2 c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> C:\D\DevBins\python-3.8.2-embed-amd64\python.exe c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> conda info --json
Starting Microsoft Python language server.
Starting Microsoft Python language server.
Diagnostic Code: NoPythonInterpretersDiagnostic, Message: Python is not installed. Please download and install Python before using the extension.
> C:\D\DevBins\python-3.8.2-embed-amd64\python.exe c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.prefix)"
cwd: c:\D\Sources\someone.private\tf.someone\someone-someproject\Tools\something
> C:\D\DevBins\python-3.8.2-embed-amd64\python.exe c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.prefix)"
cwd: c:\D\Sources\someone.private\tf.someone\someone-someproject\Tools\something
> C:\D\DevBins\python-3.8.2-embed-amd64\python.exe c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
cwd: c:\D\Sources\someone.private\tf.someone\someone-someproject\Tools\something
> C:\D\DevBins\python-3.8.2-embed-amd64\python.exe c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
cwd: c:\D\Sources\someone.private\tf.someone\someone-someproject\Tools\something
> C:\D\DevBins\python-3.8.2-embed-amd64\python.exe c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: c:\D\Sources\someone.private\tf.someone\someone-someproject\Tools\something
> C:\D\DevBins\python-3.8.2-embed-amd64\python.exe c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: c:\D\Sources\someone.private\tf.someone\someone-someproject\Tools\something
> C:\D\DevBins\python-3.8.2-embed-amd64\python.exe c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py site --user-site
cwd: c:\D\Sources\someone.private\tf.someone\someone-someproject\Tools\something
> C:\D\DevBins\python-3.8.2-embed-amd64\python.exe c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py site --user-site
cwd: c:\D\Sources\someone.private\tf.someone\someone-someproject\Tools\something
> C:\D\DevBins\python-3.8.2-embed-amd64\python.exe c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\completion.py
> C:\D\DevBins\python-3.8.2-embed-amd64\python.exe c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py c:\Users\someone\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\completion.py
> conda info --json
> conda --version

I fixed it.

The python-3.8.2-embed-amd64 installation has a different folder structure than the complete version of Python. It doesn’t have folders like Scripts, Lib, etc. But have a python38.zip which hold those folder. After I switching back to the normal complete version of Python, VSC can identify my Python interpreter now.

_Originally posted by @smwikipedia in https://github.com/microsoft/vscode-python/issues/9576#issuecomment-619024665_

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
eblaudycommented, Sep 15, 2020

Hi, can we hope that this feature will arrive one day?

3reactions
jpele-tiscommented, Sep 15, 2020

This feature is kinda critical no ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip with embedded python - Stack Overflow
and I have just found out that deleting/renaming "_pth" file frees this installation from embedded. with "_pth" file python will not recognize any...
Read more >
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 >
Err: Python is not recognized as an internal or external ...
The error is caused when Python's executable file is not found in an environment variable as a result of the Python command in...
Read more >
3. Using Python on Windows
'py' is not recognized as an internal or external command, operable program or batch file. Per-user installations of Python do not add the...
Read more >
Installing Python on Windows using the embedded package ...
Installing Python on Windows using the embedded package (no privileges needed) · Enable running powershell scripts · Get the embedable package.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found