Skip to content

something went wrong activating IntelliCode support for Python+ Error while activating Python: {} #266

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

Closed
MoElaSec opened this issue Jan 13, 2021 · 24 comments

Comments

@MoElaSec
Copy link

MoElaSec commented Jan 13, 2021

Product and Version : VSCode
OS Version : Windows
IntelliCode Extension Version: v1.2.10
Target Platform or Language : Python 3.9 (I used to have 3.8 and same problem happened)

Steps to Reproduce / Scenario:

1.Open VS-Code
2. Wait for extensions to load

No this's different from this issue #57
non of what's said there or other similar issues fixed my problem the main difference is in the output as there's no info just stops and say: Error while activating Python: {}

  • VS IntelliCode Output:
    image

  • the bottom of the long Python Output:
    image

I have many similar Errors similar to the one shown above, this is a text for the complete output:

python_output.txt

  • for reference this's all the python available on my Windows PC:
    image
@MoElaSec MoElaSec changed the title something went wrong activating IntelliCode support for Python. Please check the "Python" and "VS IntelliCode" something went wrong activating IntelliCode support for Python+ Error while activating Python: {} Jan 13, 2021
@MoElaSec
Copy link
Author

So I wasn't able to solve the problem but due to the fact I must work with flask for the time being I did the following:

  • TLDR: worked with Jedi and abandoned IntelliCode😊
  1. Disabled Visual Studio IntelliCode
  2. in settings.json I wrote:
    "python.languageServer": "Jedi",
  3. VS-Code prompts me that I should reload the python server so I clicked re-load.

& now everything is fine:
image

@markw-t
Copy link
Contributor

markw-t commented Jan 25, 2021

@savannahostrowski please can you take a look at this issue?

@jakebailey
Copy link

The error trace here seems to say that your VS Code version is too low. Can you upgrade to at least VS Code 1.51? (Your original post did not provide the VS Code version you are using.)

@markw-t
Copy link
Contributor

markw-t commented Feb 10, 2021

@MoElaSec did you have a chance to try @jakebailey 's advice? Are you running VS Code 1.51 or higher?

@markw-t
Copy link
Contributor

markw-t commented Feb 10, 2021

OK, thanks for getting back to us, and appreciate the info @MoElaSec . @jakebailey any further follow up steps possible here?

@jakebailey
Copy link

The next version of the Python extension correctly indicates its minimum version of VS Code to prevent installing it on incompatible versions, but if the issue was not fixed by updating, then we'd need a new stack trace to see what's going on.

@jakebailey
Copy link

jakebailey commented Feb 10, 2021

For reference, the info would be the "Python" output logs that you had screenshotted in the original issue (as well as the VS Code version in use).

@estringfellow
Copy link

Hi Jake,
I am experiencing the same issue. In case it's helpful, please find the stack trace from the "Python" output log below.
I'd prefer to not abandon Intellicode and go with another solution, so I appreciate any insights you might have here!
Please let me know if you require any additional info on my behalf.
Thanks!

Python Intellicode stack trace error.txt

@estringfellow
Copy link

I think I fixed it - after upgrading VSCode, there wasn't a Python interpreter selected by default for some reason. I selected a Python interpreter and that seems to have fixed the problem. I'm not getting the same error message when loading VSCode or in the Python logs.
Thanks!

@keg247
Copy link

keg247 commented Mar 10, 2021

I have the same issue while running VS Code 1.54.1. Everything worked fine in 1.52.1, but failed as soon as I updated to 1.54.1. Python output for 1.54 and corresponding output for 1.52 attached.

python_output_154.txt
python_output_152.txt

@markw-t
Copy link
Contributor

markw-t commented Mar 10, 2021

tagging @jakebailey to see @keg247 's new output

@jakebailey
Copy link

jakebailey commented Mar 10, 2021

I don't think this is related to the other users in this thread. IIRC there was some mutual bugfixes that went out for both VS Code and the Python extension to resolve some proposed API problems. @luabud or @karthiknadig may recall better if this applies.

Error 2021-03-10 15:25:14: Failed to start language server ...,
Return Value: undefined [Error: [nullExtensionDescription]: Proposed API is only available when running out of dev or with the following command line switch: --enable-proposed-api nullExtensionDescription

But, I do not know who is enabling that proposed API. "nullExtensionDescription" does not appear in the Python extension, the Pylance extension, nor in the language server client.

Perhaps there's some usage that's doing it, but I don't know much about this.

@jakebailey
Copy link

The message implies some extension has a null description, but none in the Python stack is missing the property in their package.json...

@Paril
Copy link

Paril commented Jun 8, 2021

Just noting that this is still an issue. Can't get it to work with Pylance on latest Insiders VSCode.

@nanakwasi-0
Copy link

I just ran into this issue ....for one minute its working ..I close vs code for like 2mins, I return and now I have this problem that won't let me do anything ! Help?

@markw-t
Copy link
Contributor

markw-t commented Jul 9, 2021

Tagging @luabud and @savannahostrowski to see if we can gather more info to help diagnose and solve this

@markw-t
Copy link
Contributor

markw-t commented Jul 9, 2021

@Paril @Z3ROD4RK it would be very helpful for us to see the logs associated with the failing sessions you are both seeing.

To view these, please bring up the Python output window (View menu... Output... and select Python in the drop down at the right hand end), then paste the entire log into a text file and attach to this bug. They should have diagnostic information and stack traces for the failures you are seeing which will help our team diagnose correctly.

Thanks!

@FazeelUsmani
Copy link

FazeelUsmani commented Aug 24, 2021

Intellisense is not working

Unable to navigate in VS code python file. Yesterday, it was working fine, but don't know what happened today. Tried several things but no use.

Here's the error message:
intellisense and Python error image
and vscode version is >1.5.0 on macOS Big Sur v1.5.2

Here are the vscode details:
Version: 1.59.1 (Universal)
Commit: 3866c3553be8b268c8a7f8c0482c0c0177aa8bfa
Date: 2021-08-19T11:53:52.479Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Darwin x64 20.6.0

Please help me! Can't do any work without this

Python output:

User belongs to experiment group 'pythonaa'
User belongs to experiment group 'pythonJediLSP'
User belongs to experiment group 'pythonDiscoveryModuleWithoutWatcher'
User belongs to experiment group 'pythonTensorboardExperiment'
User belongs to experiment group 'pythonSurveyNotificationcf'
User belongs to experiment group 'PythonPyTorchProfiler'
User belongs to experiment group 'pythonDeprecatePythonPath'
User belongs to experiment group 'pythonSortEnvs'
Python interpreter path: ./venv/bin/python
Error 2021-08-24 17:46:29: Failed to resolve symbolic link:  [Error: ENOENT: no such file or directory, lstat '/usr/local/bin/python2'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/usr/local/bin/python2'
}
Starting Jedi Python language engine.
> ~/workspan-network/venv/bin/python -c "import sys;print(sys.prefix)"
cwd: ~/workspan-network
> ~/workspan-network/venv/bin/python -c "import sys;print(sys.prefix)"
cwd: ~/workspan-network
> ~/workspan-network/venv/bin/python -c "import sys;print(sys.executable)"
cwd: ~/workspan-network
> ~/workspan-network/venv/bin/python -c "import sys;print(sys.executable)"
cwd: ~/workspan-network
> ~/workspan-network/venv/bin/python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: ~/workspan-network
> ~/workspan-network/venv/bin/python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: ~/workspan-network
> ~/workspan-network/venv/bin/python site --user-site
cwd: ~/workspan-network
> ~/workspan-network/venv/bin/python site --user-site
cwd: ~/workspan-network
> ~/workspan-network/venv/bin/python ~/.vscode/extensions/ms-python.python-2021.8.1159798656/pythonFiles/completion.py
> ~/workspan-network/venv/bin/python ~/.vscode/extensions/ms-python.python-2021.8.1159798656/pythonFiles/completion.py``

VS Intellisense output

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
Language server extension command failed. Exception: Error: command 'python.intellicode.loadLanguageServerExtension' not found
    at g._tryExecuteCommand (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1523:3364)
    at vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1523:3245
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error while activating Python: {}```

@jakebailey
Copy link

I'm thinking that any report that contains command 'python.intellicode.loadLanguageServerExtension' not found is due to a change in the Python extension, where it finishes activating before Pylance has loaded (and IC tries to send this command too quickly). The IC extension may need to use some other signal to know when it's safe to try and send us the model.

@FazeelUsmani
Copy link

Okay, is there any fix? @jakebailey

@ayim
Copy link
Collaborator

ayim commented Apr 4, 2022

@FazeelUsmani would you mind trying again?
We're curious if you're still seeing this issue.
Feel free to open a new issue if you are

-A

@ayim ayim closed this as completed Apr 5, 2022
@FazeelUsmani
Copy link

@ayim This is working now. Thanks!

@issam-seghir
Copy link

Going to the Python extension in the store (ms-python.python), then update the extension or switch to (pre-release) and restart VSCode fix the problem for me

@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
Projects
None yet
Development

No branches or pull requests