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.

Check interpreter details with no 'site' package (-S)

See original GitHub issue

Environment data

  • VS Code version: 1.26.0-insider 4fa62b246c4305b4ca00507551f77c58135ce928 x64
  • Extension version (available under the Extensions sidebar): 2018.7.1
  • OS and version: Linux linux 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.5 (default, Apr 1 2018, 05:46:30) [GCC 7.3.0] on linux (Ubuntu 18.04 LTS)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

Python language server does not show syntax errors as I type in code (see Python in Visual Studio Code – June & July 2018 Release)

Expected behavior

As shown on the announcement page above

Steps to reproduce:

  1. Remove ~/.vscode-insiders/extensions/ms-python.python-2018.7.1/languageServer/ if present.
  2. Download & Install code-insiders if not yet present.
  3. Set "python.jediEnabled": false
  4. Wait until the language server finishes its installation.
  5. Restart code-insiders if needed.
  6. Begin from creating hello.py example, and make intentional error def func():: as on the above-mentioned page. Observe meanwhile the message in the output:

Logs

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

Starting Microsoft Python language server.
[Info  - 19:17:51] Created Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter instance from Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory
Initializing for /usr/bin/python3

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

log.ts:159  INFO no standard startup: panel is active
TMSyntax.ts:47 Overwriting grammar scope name to file mapping for scope source.fsharp.
Old grammar file: file:///usr/share/code-insiders/resources/app/extensions/fsharp/syntaxes/fsharp.tmLanguage.json.
New grammar file: file://~/.vscode-insiders/extensions/georgewfraser.fsharp-language-server-0.1.11/syntaxes/fsharp.json
e.register @ TMSyntax.ts:47
TMSyntax.ts:47 Overwriting grammar scope name to file mapping for scope source.fsharp.
Old grammar file: file://~/.vscode-insiders/extensions/georgewfraser.fsharp-language-server-0.1.11/syntaxes/fsharp.json.
New grammar file: file://~/.vscode-insiders/extensions/ionide.ionide-fsharp-3.25.1/syntaxes/fsharp.json
e.register @ TMSyntax.ts:47
TMSyntax.ts:47 Overwriting grammar scope name to file mapping for scope source.fsharp.fsx.
Old grammar file: file://~/.vscode-insiders/extensions/georgewfraser.fsharp-language-server-0.1.11/syntaxes/fsharp.fsx.json.
New grammar file: file://~/.vscode-insiders/extensions/ionide.ionide-fsharp-3.25.1/syntaxes/fsharp.fsx.json
e.register @ TMSyntax.ts:47
TMSyntax.ts:47 Overwriting grammar scope name to file mapping for scope source.fsharp.fsi.
Old grammar file: file://~/.vscode-insiders/extensions/georgewfraser.fsharp-language-server-0.1.11/syntaxes/fsharp.fsi.json.
New grammar file: file://~/.vscode-insiders/extensions/ionide.ionide-fsharp-3.25.1/syntaxes/fsharp.fsi.json
e.register @ TMSyntax.ts:47
console.ts:136 [Extension Host] Failed to get interpreter information for '/usr/bin/python3.5' SyntaxError: Unexpected token T in JSON at position 0
        at JSON.parse (<anonymous>)
        at PythonExecutionService.<anonymous> (~/.vscode-insiders/extensions/ms-python.python-2018.7.1/out/client/common/process/pythonProcess.js:42:35)
        at Generator.next (<anonymous>)
        at fulfilled (~/.vscode-insiders/extensions/ms-python.python-2018.7.1/out/client/common/process/pythonProcess.js:12:58)
        at <anonymous> (at PythonExecutionService.<anonymous> (~/.vscode-insiders/extensions/ms-python.python-2018.7.1/out/client/common/process/pythonProcess.js:53:25))
t.log @ console.ts:136

(/usr/bin/python3 is, actually, python3.6 on this system)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
brettcannoncommented, Aug 20, 2018

[ @mprogram I edited your ✉️ ⬆️ to come off as more 😃 and less 😠 ]

We’re are checking to see if conda is installed, so the NOENT isn’t an issue.

Please try quitting VS Code, deleting the languageServer directory in the extension, and having VS Code download the language server again. If that doesn’t work on your system then you can revert back to Jedi with "python.jediEnabled": true until this specific problem is resolved.

0reactions
luabudcommented, Apr 21, 2020

Closing as fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

virtualenv --no-site-packages and pip still finding global ...
For example, I have python-django installed globally, but wish to create a virtualenv with a different Django version.
Read more >
venv — Creation of virtual environments — Python 3.11.1 ...
The venv module supports creating lightweight “virtual environments”, each with their own independent set of Python packages installed in their site ...
Read more >
Configure a Python interpreter | PyCharm Documentation
Select the Inherit global site-packages checkbox if you want all packages installed in the global Python on your machine to be added to...
Read more >
Manage Python environments and interpreters - Visual Studio ...
Install Python interpreters and packages and assign environments ... See Environments window tab reference for details about the database.
Read more >
A Guide to Python's Virtual Environments |
Scripts that ensure executed Python code uses the Python interpreter and site packages installed inside the given virtual environment.
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