Issue activating Python extension for Intellicode (looks like a venv interpreter detection issue)
See original GitHub issueEnvironment data
- VS Code version: Version: 1.54.3 (user setup)
- Extension version (available under the Extensions sidebar): v2021.3.680753044
- OS and version: Windows_NT x64 10.0.19042
- Python version (& distribution if applicable, e.g. Anaconda): 3.8.7 CPython
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv
- Relevant/affected Python packages and their versions: irrelevant
- Relevant/affected Python-related VS Code extensions and their versions: Python: v2021.3.680753044 with Intellicode: v1.2.12, also the pairing Python: 2021.3.658691958 with Intellicode: v1.2.11 exhibits the same issue
- Value of the
python.languageServer
setting: “Pylance”
[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'
), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]
Expected behaviour
Intellicode loads properly
Actual behaviour
Error message as a notification : Sorry, something went wrong activating IntelliCode support for Python. Please check the “Python” and “VS IntelliCode” output windows for details.
Syntax coloration is partly broken (namely imports are not colored in green), autocompletion fails. The system python seems to work ok, but as soon as trying to change the interpreter there is an issue with the python interpreter not being recognized properly in the venv it seems.
Manually entering the path to the interpreter seems to work.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
- Set interpreter to venv for workspace (manually if it is not auto detected)
- Close workspace
- Open workspace
- Issue is triggered
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
User belongs to experiment group 'pythonaa'
User belongs to experiment group 'pythonJediLSPcf'
User belongs to experiment group 'pythonSendEntireLineToREPL'
User belongs to experiment group 'pythonNotDisplayLinterPrompt'
User belongs to experiment group 'pythonDiscoveryModule'
User belongs to experiment group 'pythonTensorboardExperiment'
User belongs to experiment group 'PythonPyTorchProfiler'
User belongs to experiment group 'ShowExtensionSurveyPrompt - control'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
Error 2021-03-30 10:23:05: Fetching environments via the new API failed [Error: invalid version -final
at Object.u [as parseBasicVersion] (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:9:198256)
at V (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:37379)
at Array.map (<anonymous>)
at q.getInterpretersViaAPI (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:39997)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async q.getInterpreters (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:39311)
at async C.getInterpreters (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:61:740434)]
Error 2021-03-30 10:23:05: Fetching environments via the new API failed [Error: invalid version -final
at Object.u [as parseBasicVersion] (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:9:198256)
at V (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:37379)
at Array.map (<anonymous>)
at q.getInterpretersViaAPI (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:39997)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async q.getInterpreters (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:39311)
at async C.getInterpreters (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:61:740434)]
Error 2021-03-30 10:23:05: Fetching environments via the new API failed [Error: invalid version -final
at Object.u [as parseBasicVersion] (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:9:198256)
at V (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:37379)
at Array.map (<anonymous>)
at q.getInterpretersViaAPI (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:39997)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async q.getInterpreters (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:39311)
at async C.getInterpreters (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:61:740434)]
Error 2021-03-30 10:23:05: Fetching environments via the new API failed [Error: invalid version -final
at Object.u [as parseBasicVersion] (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:9:198256)
at V (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:37379)
at Array.map (<anonymous>)
at q.getInterpretersViaAPI (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:39997)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async q.getInterpreters (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:39311)
at async g.onAutoSelectInterpreter (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:61:702846)
at async g.autoSelectInterpreter (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:9:280746)]
Error 2021-03-30 10:23:05: Fetching environments via the new API failed [Error: invalid version -final
at Object.u [as parseBasicVersion] (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:9:198256)
at V (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:37379)
at Array.map (<anonymous>)
at q.getInterpretersViaAPI (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:39997)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async q.getInterpreters (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:39311)
at async C.getInterpreters (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:61:740434)
at async p.onAutoSelectInterpreter (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:61:705770)
at async p.autoSelectInterpreter (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:9:280746)]
Error 2021-03-30 10:23:05: Python Extension: interpreterManager.refresh [Error: invalid version -final
at Object.u [as parseBasicVersion] (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:9:198256)
at V (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:37379)
at q.getInterpreterDetails (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:38849)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async C.getInterpreterDetails (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:61:741545)
at async f.updateDisplay (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:61:729765)
at async f.refresh (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:61:729292)]
Error 2021-03-30 10:23:05: Failed to activate a workspace, Class name = y, completed in 374ms, has a falsy return value, Arg 1: <Uri:c:\Users\redacted\Documents\redacted\code\compiler\zonnx\exporter\export.py>, Return Value: undefined [Error: invalid version -final
at Object.u [as parseBasicVersion] (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:9:198256)
at V (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:37379)
at q.getInterpreterDetails (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:38849)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async C.getInterpreterDetails (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:61:741545)
at async _.activate (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:52:29881)
at async Promise.all (index 4)
at async y.activateWorkspace (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:52:25098)]
Error 2021-03-30 10:23:05: Failure during activation. [Error: invalid version -final
at Object.u [as parseBasicVersion] (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:9:198256)
at V (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:37379)
at q.getInterpreterDetails (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:38849)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async C.getInterpreterDetails (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:61:741545)
at async _.activate (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:52:29881)
at async Promise.all (index 4)
at async y.activateWorkspace (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:52:25098)]
Error 2021-03-30 10:23:05: sendStartupTelemetry() failed. [Error: invalid version -final
at Object.u [as parseBasicVersion] (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:9:198256)
at V (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:37379)
at q.getInterpreterDetails (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:80:38849)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async C.getInterpreterDetails (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:61:741545)
at async _.activate (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:52:29881)
at async Promise.all (index 4)
at async y.activateWorkspace (c:\Users\redacted\.vscode\extensions\ms-python.python-2021.3.680753044\out\client\extension.js:52:25098)]
Python interpreter path: c:\Users\redacted\Documents\redacted\code\compiler\venv\Scripts\python.exe
Intellicode output:
Language server is set to Pylance.
Acquiring model
Acquiring model 'intellisense-members-lstm-pylance' for python
Querying IntelliCode service for available models.
vs-intellicode-python was passed a model: {}.
Cached model is up to date.
Activating Python extension
Error while activating Python: {}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9
Experiencing the same issue.
This worked for me, too. After executing the
Python: Select Interpreter
command from the command palette and specifying the right python interpreter, the syntax highlighting and the autocompletion recovered to normal.This is probably stale as the issue did not seem to re-occur. Closing