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 3.9.7 interpreter is not found on Windows

See original GitHub issue

Environment Data

VS Code version: 1.60.0 (user setup) (Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff) Extension version : v2021.9.1230869389 OS and version: Windows_NT x64 10.0.22000 Python version : 3.9.7 Type of virtual environment used N/A

Expected Behavior

Python interpreter is found and I can write code. Result of executing py -3 -c "import sys;print(sys.executable) is C:\Program Files\Python39\python.exe

Actual Behavior

  1. Python extension loading progress bar is stuck rotating infinitely.
  2. Python: Select interpreter shows nothing.

Logs

Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

> pyenv root
> python3.7 -c "import sys;print(sys.executable)"
> python3.6 -c "import sys;print(sys.executable)"
> python3 -c "import sys;print(sys.executable)"
> python2 -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> py -3.7 -c "import sys;print(sys.executable)"
> py -3.6 -c "import sys;print(sys.executable)"
> py -3 -c "import sys;print(sys.executable)"
> py -2 -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> conda info --json
Error 2021-09-14 09:57:17: Detection of Python Interpreter for Command py and args -3.7 failed as file Python 3.7 not found!

 -3.9-64 does not exist
Error 2021-09-14 09:57:17: Detection of Python Interpreter for Command py and args -2 failed as file Python 2 not found!

 -3.9-64 does not exist
Error 2021-09-14 09:57:17: Detection of Python Interpreter for Command py and args -3.6 failed as file Python 3.6 not found!

 -3.9-64 does not exist

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:8

github_iconTop GitHub Comments

1reaction
Timsonroblcommented, Sep 14, 2021

@karrtikr here they are settings.txt

1reaction
Timsonroblcommented, Sep 14, 2021

@Timsonrobl Can you add the following User setting and see if it helps:

"python.experiments.optInto": ["pythonDiscoveryModuleWithoutWatcher"]

Yes, adding this line actually seems to fix this issue and at least lets me select interpreter.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Select and install Python interpreters - Visual Studio (Windows)
A complete list of Python interpreters that are supported in Visual Studio with brief instructions on where to find their installers.
Read more >
hello_world.py not found when using Python 3.9.7 and ...
The above error is specifically referring to the executable that Sublime is trying to run. It is looking for py.exe somewhere in your...
Read more >
Configure a system interpreter | PyCharm Documentation
Press Ctrl+Alt+S to open Settings/Preferences and go to Project: <project name> | Python Interpreter. Click the Add Interpreter link next to the ...
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 >
Python is not recognized as an internal or external command
One way to fix the error would be to launch Python from the Command Prompt by passing in the full path to the...
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