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

Invalid "Python is not installed" error #12044

Closed
McCroden opened this issue May 28, 2020 · 5 comments
Closed

Invalid "Python is not installed" error #12044

McCroden opened this issue May 28, 2020 · 5 comments
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@McCroden
Copy link

McCroden commented May 28, 2020

Environment data

  • VS Code version: 1.45.1
  • Extension version (available under the Extensions sidebar): 2020.5.80290
  • OS and version: Windows_NT x64 10.0.17763
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8 python.org; 3.5, 3.6, 3.7 anaconda
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv, conda
  • Relevant/affected Python packages and their versions: python 3.5 - 3.8
  • Relevant/affected Python-related VS Code extensions and their versions: Python 2020.5.80290 through at least 2020.3.69010
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version #3977): False
  • Value of the python.languageServer setting: Microsoft

Expected behaviour

VS Code should detect my python environments.

Actual behaviour

VS Code does not detect my python environments.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Open VS Code
  2. Make a new python file or wait for python extension to load
  3. Bottom bar says "Select Python Interpreter"
  4. Popup saying "Python is not installed. ..."

Logs

I tried downgrading python extension all the way to 2020.3.69010 and none worked.

In settings I have also specified where the python.org exe is located as well as the anaconda exe.

Work computer. Colleagues are also having issues.
**I think the issue may be that ~ does not resolve to my C: drive. **

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

User belongs to experiment group 'WebHostNotebook - control'
User belongs to experiment group 'LocalZMQKernel - control'
User belongs to experiment group 'NativeNotebook - control'
User belongs to experiment group 'CollectLSRequestTiming - experiment'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'RunByLine - control'
> 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.6 -c "import sys;print(sys.executable)"
> py -3.7 -c "import sys;print(sys.executable)"
> py -3 -c "import sys;print(sys.executable)"
> py -2 -c "import sys;print(sys.executable)"
> c:\Users\username\AppData\Local\anaconda3\envs\py38\python.exe -c "import sys;print(sys.executable)"
> ~\AppData\Local\anaconda3\Scripts\conda.exe info --json
> ~\AppData\Local\anaconda3\Scripts\conda.exe info --json
> ~\AppData\Local\anaconda3\Scripts\conda.exe env list
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.
> ~\AppData\Local\anaconda3\Scripts\conda.exe info --json
> ~\AppData\Local\anaconda3\Scripts\conda.exe env list
> ~\AppData\Local\anaconda3\Scripts\conda.exe info --json


Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

console.ts:137 [Extension Host] Error Python Extension: 2020-05-28 14:56:38: Failed to get interpreter information for 'c:\Users\username\AppData\Local\anaconda3\envs\py38\python.exe' [Error: Command failed: "c:\\Users\username\AppData\Local\anaconda3\envs\py38\python.exe" "c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\pythonFiles\pyvsc-run-isolated.py" "c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\pythonFiles\interpreterInfo.py"

	at ChildProcess.exithandler (child_process.js:308:12)
	at ChildProcess.emit (events.js:203:13)
	at maybeClose (internal/child_process.js:1021:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)] {
  killed: true,
  code: null,
  signal: 'SIGTERM',
  cmd: '"c:\\\\Users\\username\\AppData\\Local\\anaconda3\\envs\\py38\\python.exe" "c:\\Users\\username\\.vscode\\extensions\\ms-python.python-2020.5.80290\\pythonFiles\\pyvsc-run-isolated.py" "c:\\Users\\username\\.vscode\\extensions\\ms-python.python-2020.5.80290\\pythonFiles\\interpreterInfo.py"'
}
console.ts:137 [Extension Host] Error Python Extension: 2020-05-28 14:56:39: Detection of Python Interpreter for Command py and args -2 c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\pythonFiles\pyvsc-run-isolated.py -c import sys;print(sys.executable) failed as file Python 2 not found!

 -3.8-64
 -3.7-64 does not exist
console.ts:137 [Extension Host] Error Python Extension: 2020-05-28 14:56:53: Failed to get interpreter information for 'c:\Users\username\AppData\Local\anaconda3\envs\py38\python.exe' [Error: Command failed: "c:\\Users\username\AppData\Local\anaconda3\envs\py38\python.exe" "c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\pythonFiles\pyvsc-run-isolated.py" "c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\pythonFiles\interpreterInfo.py"

	at ChildProcess.exithandler (child_process.js:308:12)
	at ChildProcess.emit (events.js:203:13)
	at maybeClose (internal/child_process.js:1021:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)] {
  killed: true,
  code: null,
  signal: 'SIGTERM',
  cmd: '"c:\\\\Users\\username\\AppData\\Local\\anaconda3\\envs\\py38\\python.exe" "c:\\Users\\username\\.vscode\\extensions\\ms-python.python-2020.5.80290\\pythonFiles\\pyvsc-run-isolated.py" "c:\\Users\\username\\.vscode\\extensions\\ms-python.python-2020.5.80290\\pythonFiles\\interpreterInfo.py"'
}
console.ts:137 [Extension Host] Error Python Extension: 2020-05-28 14:56:53: Failed to get analysis options, Class name = u, completed in 0ms, has a falsy return value, , Return Value: undefined [Error: did not find an active interpreter
	at f.getInitializationOptions (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:90:130982)
	at f.getAnalysisOptions (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:16:182573)
	at f.s.value (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:1:9412)
	at r.startLanguageServer (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:90:147542)
	at r.s.value (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:1:9412)
	at r.c.value (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:1:12954)
	at r.start (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:90:146760)
	at processTicksAndRejections (internal/process/task_queues.js:85:5)]
console.ts:137 [Extension Host] Error Python Extension: 2020-05-28 14:56:53: Starting Language Server, Class name = r, completed in 7ms, has a falsy return value, , Return Value: undefined [Error: did not find an active interpreter
	at f.getInitializationOptions (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:90:130982)
	at f.getAnalysisOptions (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:16:182573)
	at f.s.value (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:1:9412)
	at r.startLanguageServer (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:90:147542)
	at r.s.value (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:1:9412)
	at r.c.value (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:1:12954)
	at r.start (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:90:146760)
	at processTicksAndRejections (internal/process/task_queues.js:85:5)] {
  vslsStack: [
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {}
  ]
}
console.ts:137 [Extension Host] Error Python Extension: 2020-05-28 14:56:53: Failed to start Language Server, Class name = r, completed in 17ms, has a falsy return value, Arg 1: undefined, Arg 2: undefined, Return Value: undefined [Error: did not find an active interpreter
	at f.getInitializationOptions (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:90:130982)
	at f.getAnalysisOptions (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:16:182573)
	at f.s.value (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:1:9412)
	at r.startLanguageServer (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:90:147542)
	at r.s.value (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:1:9412)
	at r.c.value (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:1:12954)
	at r.start (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:90:146760)
	at processTicksAndRejections (internal/process/task_queues.js:85:5)] {
  vslsStack: [
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {}
  ]
}
console.ts:137 [Extension Host] Error Python Extension: 2020-05-28 14:56:53: Failed to activate language server, Class name = l, completed in 59ms, has a falsy return value, Arg 1: undefined, Arg 2: undefined, Return Value: undefined [Error: did not find an active interpreter
	at f.getInitializationOptions (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:90:130982)
	at f.getAnalysisOptions (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:16:182573)
	at f.s.value (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:1:9412)
	at r.startLanguageServer (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:90:147542)
	at r.s.value (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:1:9412)
	at r.c.value (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:1:12954)
	at r.start (c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\out\client\extension.js:90:146760)
	at processTicksAndRejections (internal/process/task_queues.js:85:5)] {
  vslsStack: [
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {},
    CallSite {}
  ]
}
console.ts:137 [Extension Host] Error Python Extension: 2020-05-28 14:56:53: Diagnostic Code: NoPythonInterpretersDiagnostic, Message: Python is not installed. Please download and install Python before using the extension.
notificationsAlerts.ts:40 Python is not installed. Please download and install Python before using the extension.
console.ts:137 [Extension Host] Error Python Extension: 2020-05-28 14:56:59: Detection of Python Interpreter for Command py and args -3.6 c:\Users\username\.vscode\extensions\ms-python.python-2020.5.80290\pythonFiles\pyvsc-run-isolated.py -c import sys;print(sys.executable) failed as file Python 3.6 not found!

 -3.8-64
 -3.7-64 does not exist

@McCroden McCroden added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels May 28, 2020
@karthiknadig
Copy link
Member

Dupe of #11870

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label May 29, 2020
@McCroden
Copy link
Author

@karrtikr just a reminder the person from issue #11870 said an older version of the extension fixed the issue for them, but it did not fix it for me. I tested all the way back to 2020.3.69010.

@karthiknadig
Copy link
Member

@McCroden We have a hypothesis for why this is occurring. The issue is intermittent, you might be seeing it today, it might entirely disappear with the next release. We have marked the issue as needs PR, we will address it (based on our hypothesis). One problem we have had with this one is that no one in our team has been able to reproduce this, making it harder to diagnose.

@McCroden
Copy link
Author

McCroden commented May 29, 2020

@karthiknadig okay, sounds good. My colleague and I both use vs code at work and both have this issue. Our ~ is not on the C: drive--it's actually our Z: drive. I see ~ used in the logs above so I thought maybe that had something to do with the issue. The env variable is %HOMEDRIVE% with a value of z:. But python (and everything else) is installed on C: drive.

@karthiknadig
Copy link
Member

We calculate home directory path, and replace it with ~ for the logs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants