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

Sorry, something went wrong activating IntelliCode support for Python #50

Closed
vvvlad opened this issue Jul 3, 2020 · 34 comments
Closed
Assignees
Labels
needs investigation Could be an issue - needs investigation

Comments

@vvvlad
Copy link

vvvlad commented Jul 3, 2020

Getting the following error after installing pylance

Sorry, something went wrong activating IntelliCode support for Python. Please check the "Python" and "VS IntelliCode" output windows for details.

Version: 1.46.1
Commit: cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
Date: 2020-06-17T21:17:14.222Z
Electron: 7.3.1
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.5.0

python 3.8.2
macos catalina

Environment data

Language server is set to Pylance.
Acquiring model
Acquiring model 'intellisense-members-lstm' for python
Querying IntelliCode service for available models.
vs-intellicode-python was passed a model: {}.
Cached model is up to date.
Activating Python extension
Language server extension command failed. Exception: Error: command 'python.intellicode.loadLanguageServerExtension' not found
at e._tryExecuteCommand (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:3900:893)
at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:3900:774
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:85:5)
Error while activating Python: {}

Expected behaviour

Not getting any errors.

Actual behaviour

Sorry, something went wrong activating IntelliCode support for Python. Please check the "Python" and "VS IntelliCode" output windows for details.

@judej judej added the needs investigation Could be an issue - needs investigation label Jul 9, 2020
@MikhailArkhipov
Copy link

This may happen when IntelliCode (1.2.9+) sends command to Pylance while Pylance is not loaded. IntelliCode checks for

"python.languageServer": "Pylance"

Have you seen it once, such as right after install of Pylance (and reload window perhaps helped) or is it consistent?

@vvvlad
Copy link
Author

vvvlad commented Jul 12, 2020

No, I see this constantly.
Tried to disable Intellicode, but when re-enable, I get the error message again as soon as I open .py file.

@mvaaltola
Copy link

mvaaltola commented Jul 14, 2020

I'm also constantly getting the same message, with the following output from VS Intellicode:

Language server is set to Pylance.
Acquiring model
Acquiring model 'intellisense-members-lstm' for python
Querying IntelliCode service for available models.
vs-intellicode-python was passed a model: {}.
Cached model is up to date.
Activating Python extension
Language server extension command failed. Exception: Error: command 'python.intellicode.loadLanguageServerExtension' not found
    at u._tryExecuteCommand (file:///usr/lib/code/out/vs/workbench/workbench.desktop.main.js:3943:836)
    at file:///usr/lib/code/out/vs/workbench/workbench.desktop.main.js:3943:717
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
Error while activating Python: {}

on Arch Linux with Python 3.8.3 and code 1.47.0.

@smcoll
Copy link

smcoll commented Jul 19, 2020

Same problem here, and the settings editor is not accepting "Pylance" as a valid value for "python.languageServer":

Value is not accepted. Valid values: "Jedi", "Microsoft", "None".

This is with the Pylance extension installed and enabled. i tried uninstalling and reinstalling Pylance but it's the same situation.

Ubuntu 20.04, code 1.47.1

@mvaaltola
Copy link

Same problem here, and the settings editor is not accepting "Pylance" as a valid value for "python.languageServer":

Value is not accepted. Valid values: "Jedi", "Microsoft", "None".

This is with the Pylance extension installed and enabled. i tried uninstalling and reinstalling Pylance but it's the same situation.

Ubuntu 20.04, code 1.47.1

I also get the same error in the settings. However, in another issue I found a mention that this is expected and does not affect the functioning of Pylance, and I can confirm Pyright type checking still works despite this error. I belive this error is not related to the issues with IntelliCode support.

@crisbal
Copy link

crisbal commented Jul 27, 2020

I can report the same issue here:

IntelliCode Output

Language server is set to Pylance.
Acquiring model
Acquiring model 'intellisense-members-lstm' for python
Querying IntelliCode service for available models.
vs-intellicode-python was passed a model: {}.
Cached model is up to date.
Activating Python extension
Language server extension command failed. Exception: Error: command 'python.intellicode.loadLanguageServerExtension' not found
    at u._tryExecuteCommand (file:///usr/lib/code/out/vs/workbench/workbench.desktop.main.js:3943:836)
    at file:///usr/lib/code/out/vs/workbench/workbench.desktop.main.js:3943:717
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
Error while activating Python: {}

Python output

User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - control'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'LocalZMQKernel - control'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'RunByLine - control'
User belongs to experiment group 'CustomEditorSupport - control'
User belongs to experiment group 'pythonaacf'
> conda --version
> pyenv root
> python3.7 ~/.vscode-oss/extensions/ms-python.python-2020.7.96456/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 ~/.vscode-oss/extensions/ms-python.python-2020.7.96456/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 ~/.vscode-oss/extensions/ms-python.python-2020.7.96456/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 ~/.vscode-oss/extensions/ms-python.python-2020.7.96456/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode-oss/extensions/ms-python.python-2020.7.96456/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode-oss/extensions/ms-python.python-2020.7.96456/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> conda info --json
> python ~/.vscode-oss/extensions/ms-python.python-2020.7.96456/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode-oss/extensions/ms-python.python-2020.7.96456/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> pyenv root
Error 2020-07-27 09:51:07: Failed to check if file needs to be fixed [EntryNotFound (FileSystemError): Unable to read file '/home/crisbal/.config/Code/User/settings.json' (EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, open '/home/crisbal/.config/Code/User/settings.json')
	at _handleError (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:657:25)
	at async v.readText (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:1:571666)
	at async p.doesFileNeedToBeFixed (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:48:932592)
	at async /home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:48:931719
	at async Promise.all (index 0)
	at async p.getFilesToBeFixed (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:48:931665)
	at async p.updateTestSettings (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:48:931292)] {
  code: 'FileNotFound',
  name: 'EntryNotFound (FileSystemError)'
}
Error 2020-07-27 09:51:07: Failed to check if file needs to be fixed [EntryNotFound (FileSystemError): Unable to read file '/home/crisbal/my-project/.vscode/settings.json' (EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, open '/home/crisbal/my-project/.vscode/settings.json')
	at _handleError (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:657:25)
	at async v.readText (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:1:571666)
	at async p.doesFileNeedToBeFixed (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:48:932592)
	at async /home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:48:931719
	at async Promise.all (index 1)
	at async p.getFilesToBeFixed (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:48:931665)
	at async p.updateTestSettings (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:48:931292)] {
  code: 'FileNotFound',
  name: 'EntryNotFound (FileSystemError)'
}
Starting Pylance language server.
Python interpreter path: ./venv/bin/python3
Error 2020-07-27 09:51:08: Failed to ensure language server is available, Class name = f, completed in 25ms, has a falsy return value, Arg 1: <Uri:/home/crisbal/my-project/deploy.py>, Return Value: undefined [Error: You may only use the Pylance extension with Visual Studio Code, Visual Studio or Xamarin Studio software
to help you develop and test your applications.
The software is licensed, not sold.
This agreement only gives you some rights to use the software.
Microsoft reserves all other rights
You may not work around any technical limitations in the software;
reverse engineer, decompile or disassemble the software
remove, minimize, block or modify any notices of Microsoft or 
its suppliers in the software share, publish, rent, or lease 
the software, or provide the software as a stand-alone hosted as solution for others to use.
	at /home/crisbal/.vscode-oss/extensions/ms-python.vscode-pylance-2020.7.3/dist/extension.js:1:21232
	at /home/crisbal/.vscode-oss/extensions/ms-python.vscode-pylance-2020.7.3/dist/extension.js:1:21251
	at Generator.next (<anonymous>)
	at /home/crisbal/.vscode-oss/extensions/ms-python.vscode-pylance-2020.7.3/dist/extension.js:1:19316
	at new Promise (<anonymous>)
	at _0x518249 (/home/crisbal/.vscode-oss/extensions/ms-python.vscode-pylance-2020.7.3/dist/extension.js:1:18652)
	at _0x12e4ff.<computed> (/home/crisbal/.vscode-oss/extensions/ms-python.vscode-pylance-2020.7.3/dist/extension.js:1:19811)
	at Function._callActivateOptional (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:837:509)
	at Function._callActivate (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:837:160)
	at /usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:835:703
	at async Promise.all (index 0)
	at async g.languageServerFolder (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:46:187483)
	at async getLanguageServerFolderName (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:46:186977)
	at async f.ensureLanguageServerFileIsAvailable (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:24:27637)
	at async f.ensureLanguageServerIsAvailable (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:46:183035)]
Starting Pylance language server.
Error 2020-07-27 09:51:08: Failed to activate language server, Class name = l, completed in 28ms, has a falsy return value, Arg 1: <Uri:/home/crisbal/my-project/deploy.py>, Arg 2: {"architecture":3,"path":"/home/crisbal/my-project/venv/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.8.3-final","major":3,"minor":8,"patch":3,"prerelease":["final"],"build":[],"version":"3.8.3-final"},"sysPrefix":"/home/crisbal/my-project/venv","fileHash":"56fabe1e1884fe56fd726ffdb7183b182fb4c229d156a6608aba7f18557206563b704e72259f61da12082dbfd465906dd9396b7dead44626a6db6dc97a49aede","type":"Venv","envName":"venv","displayName":"Python 3.8.3 64-bit ('venv': venv)"}, Return Value: undefined [Error: You may only use the Pylance extension with Visual Studio Code, Visual Studio or Xamarin Studio software
to help you develop and test your applications.
The software is licensed, not sold.
This agreement only gives you some rights to use the software.
Microsoft reserves all other rights
You may not work around any technical limitations in the software;
reverse engineer, decompile or disassemble the software
remove, minimize, block or modify any notices of Microsoft or 
its suppliers in the software share, publish, rent, or lease 
the software, or provide the software as a stand-alone hosted as solution for others to use.
	at /home/crisbal/.vscode-oss/extensions/ms-python.vscode-pylance-2020.7.3/dist/extension.js:1:21232
	at /home/crisbal/.vscode-oss/extensions/ms-python.vscode-pylance-2020.7.3/dist/extension.js:1:21251
	at Generator.next (<anonymous>)
	at /home/crisbal/.vscode-oss/extensions/ms-python.vscode-pylance-2020.7.3/dist/extension.js:1:19316
	at new Promise (<anonymous>)
	at _0x518249 (/home/crisbal/.vscode-oss/extensions/ms-python.vscode-pylance-2020.7.3/dist/extension.js:1:18652)
	at _0x12e4ff.<computed> (/home/crisbal/.vscode-oss/extensions/ms-python.vscode-pylance-2020.7.3/dist/extension.js:1:19811)
	at Function._callActivateOptional (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:837:509)
	at Function._callActivate (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:837:160)
	at /usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:835:703
	at async Promise.all (index 0)
	at async g.languageServerFolder (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:46:187483)
	at async getLanguageServerFolderName (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:46:186977)
	at async f.ensureLanguageServerFileIsAvailable (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:24:27637)
	at async f.ensureLanguageServerIsAvailable (/home/crisbal/.vscode-oss/extensions/ms-python.python-2020.7.96456/out/client/extension.js:46:183035)]

My setup:

  • Arch Linux x86_64, Kernel: 5.7.9-arch1-1
  • VSCode: 1.47.2-2
  • Extensions: Pylance, Python, Visual Studio Intellicode

@jakebailey
Copy link
Member

jakebailey commented Jul 27, 2020

@crisbal Your issue is different; as the python output is stating, Pylance is only available in the official VS Code builds. #135 (comment)

(On Arch, you can build a package with visual-studio-code-bin in the AUR; that's what I do.)

@MikhailArkhipov
Copy link

MikhailArkhipov commented Jul 27, 2020

@vvvlad and @mvaaltola - are you still seeing the issue? We've made some improvements so I am wondering if they worked for you. They should be at least in insiders channel.

@smcoll
Copy link

smcoll commented Jul 27, 2020

I also get the same error in the settings. However, in another issue I found a mention that this is expected and does not affect the functioning of Pylance, and I can confirm Pyright type checking still works despite this error. I belive this error is not related to the issues with IntelliCode support.

@mvaaltola thank you - i see issue #16 now

@mvaaltola
Copy link

@MikhailArkhipov still having this issue after updating to Code 1.47.3.

@jakebailey
Copy link
Member

Just to be clear @mvaaltola, you are using an official build of VS Code, correct? And not one built from scratch? "Code" sounds like an unofficial build, and Pylance doesn't work on those.

@MikhailArkhipov
Copy link

@mvaaltola - the change is in insiders build of Python extension. Try setting this to daily so you'd get latest extension

image

image

@amachanic
Copy link

I am having the same problem, and I don't think it's PyLance related. I flipped to daily insiders build as suggested by @MikhailArkhipov and also uninstalled PyLance. Neither fixed it...

@MikhailArkhipov
Copy link

MikhailArkhipov commented Aug 5, 2020

Language server extension command failed. Exception: Error: command 'python.intellicode.loadLanguageServerExtension' not found is absolutely Pylance related since Pylance exposes the command. When Pylance is not installed then command will definitely fail. If Pylance is installed, but this happens it means Pylance hasn't started by the time IntelliCode sends the command.

So, what is the IntelliCode output with insiders daily + Pylance?

@mvaaltola
Copy link

Just a quick update. I tried installing the latest Visual Studio Code insiders with the Python, Pylance, and IntelliCode extensions, and setting "python.languageServer": "Pylance". No errors are displayed when opening a Python project.

I suspect the original issue may at least for me be related to an "unofficial" build as @jakebailey suggested. I'm running "Code - OSS" from the community/code package from the Arch Linux repository. Type checking and other Pylance features seem to work OK on that version, only thing causing an error is IntelliCode.

@MikhailArkhipov
Copy link

@mvaaltola - so, you are running latest

image

ans still get the intellicode error?

@mvaaltola
Copy link

@MikhailArkhipov ah, perhaps I should've been a bit more clear. I get no errors on the latest official VS Code Insiders with freshly installed Python, Pylance and IntelliCode plugins, everything seems to work fine.

I only get the error on my main "Code - OSS" build with the latest Pylance and Python extensions. They're not daily builds (can't seem to install them on my vscode build), but neither was the version I tried on the insiders build. I assume the error has something to do with the "Code - OSS" build not being officially supported by Pylance.

@MikhailArkhipov
Copy link

Yes, that might be the case.

@MikhailArkhipov
Copy link

OK, I am going to close the issue since Pylance works with stock VS Code. Other builds are not supported and Python extension most probably falls back to Jedi language support which is not compatible with IntelliCode.

@joshuamwolfe
Copy link

Ive started getting this error as well. Ive tried deleting pylance, python, and intellicode extensions a couple of times. Are their other ideas to solve this issue?

@longer-is-better
Copy link

same with joshuamwolfe

@jakebailey
Copy link
Member

@longer-is-better The above user opened #1118 to cover their issue; if yours is the same we can comment there, otherwise this is an old unrelated issue and we'd appreciate a new one instead.

@viiicky
Copy link

viiicky commented Jul 21, 2021

For me the issue was, if the value for python.languageServer was set to Default (which is Pylance for me), I was getting this error, and Intellisense was not working. When I changed the value inside the dropdown from Default to Pylance explicitly, this error went away, and Intellisense started to work.

@Tes3awy
Copy link

Tes3awy commented Aug 23, 2021

Release v2021.8.2 is giving the same error again. Rolling back to 2021.8.1 gives no error.

Version: 1.59.1 (system setup)
Commit: 3866c3553be8b268c8a7f8c0482c0c0177aa8bfa
Date: 2021-08-19T11:56:46.957Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Windows_NT x64 10.0.19043

@jakebailey
Copy link
Member

Nothing changed in our IntelliCode support between those versions; the only explanation I can come up with is that the IC extension is sending some command too early or something.

In any case, the current issue for this is: #1664

Any info you can provide from your logs would be helpful there.

@dragonscraper
Copy link

dragonscraper commented Sep 6, 2024

what cause the problem for me was iupdating the extensions python and pylance so i downgrade both of them and that solved the problem

@harish23-ix
Copy link

what cause the problem for me is updating the extensions python and pylance so i downgrade and both of them and that solved the problem

This is what worked for me after 2hours of searching.

@ryansherby
Copy link

Downgraded as well. This is such a shame.

@shubham0204
Copy link

Downgrading the Python extension to 2023.22.1 solved the issue with me, which was caused because of the latest 2024.* versions.

To downgrade, open the extensions panel, click the 'gear' icon on the Python extension, and select Install Another Version.

Image

@mohemos
Copy link

mohemos commented Oct 25, 2024

In my case, this issue happened because Pylance was disabled. I enabled it and everything started working fine after 2 days of trying.

@planemanner
Copy link

Currently, I also had undergone same issue.

However, it can be easily resolved with just downgrading the version of python extension.

Try it if you face this problem.

@leonk-sportsbet
Copy link

Why is this issue marked as closed?
v2024.14.0 - is breaking IntelliSense code completion for python (This extension - https://marketplace.visualstudio.com/items?itemName=ms-python.python)

Please mark as unresolved!

I had to downgrade to v2023.22.1 as mentioned above by other to resolve the issue:

Image

@rchiodo
Copy link
Contributor

rchiodo commented Dec 9, 2024

@leonk-sportsbet , This issue is really old. You should open a new issue if you want help resolving your problem. There's likely a different cause for the problem.

@rocheparadox
Copy link

I faced the same issue. In my case, pylance extension, which is required for intellicode was not active. I found out that the pylance for my vscode version was not supported anymore. Updating the VS code to the latest version fixed this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation Could be an issue - needs investigation
Projects
None yet
Development

No branches or pull requests