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

Activating extension ms-python.python failed: Missing required @injectable annotation in: PersistentStateFactory. #432

Closed
viewstar000 opened this issue Dec 15, 2017 · 17 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@viewstar000
Copy link

Environment data

VS Code version: 1.19.0
Python Extension version: 0.9.0
Python Version: python2.7 & python3.6 (home-brew)
OS and version: macOS High Sierra 10.13.2

Actual behavior

Activating extension ms-python.python failed

Logs

[Extension Host] Here is the error stack: Error: Missing required @Injectable annotation in: PersistentStateFactory.
at getTargets (/Users/lili01/.vscode/extensions/ms-python.python-0.9.0/node_modules/inversify/lib/planning/reflection_utils.js:19:15)
at Object.getDependencies (/Users/lili01/.vscode/extensions/ms-python.python-0.9.0/node_modules/inversify/lib/planning/reflection_utils.js:10:19)
at /Users/lili01/.vscode/extensions/ms-python.python-0.9.0/node_modules/inversify/lib/planning/planner.js:106:55
at Array.forEach (native)
at _createSubRequests (/Users/lili01/.vscode/extensions/ms-python.python-0.9.0/node_modules/inversify/lib/planning/planner.js:94:24)
at Object.plan (/Users/lili01/.vscode/extensions/ms-python.python-0.9.0/node_modules/inversify/lib/planning/planner.js:138:5)
at Container._planAndResolve (/Users/lili01/.vscode/extensions/ms-python.python-0.9.0/node_modules/inversify/lib/container/container.js:245:37)
at Container._get (/Users/lili01/.vscode/extensions/ms-python.python-0.9.0/node_modules/inversify/lib/container/container.js:238:44)
at Container.get (/Users/lili01/.vscode/extensions/ms-python.python-0.9.0/node_modules/inversify/lib/container/container.js:197:21)
at ServiceManager.get (/Users/lili01/.vscode/extensions/ms-python.python-0.9.0/out/client/ioc/serviceManager.js:41:89)
at /Users/lili01/.vscode/extensions/ms-python.python-0.9.0/out/client/extension.js:85:55
at Generator.next ()
at __awaiter (/Users/lili01/.vscode/extensions/ms-python.python-0.9.0/out/client/extension.js:7:71)
at Promise ()
at __awaiter (/Users/lili01/.vscode/extensions/ms-python.python-0.9.0/out/client/extension.js:3:12)
at activate (/Users/lili01/.vscode/extensions/ms-python.python-0.9.0/out/client/extension.js:66:12)
at Function.t._callActivateOptional (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:512:370)
at Function.t._callActivate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:512:54)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:511:329
at Object.g [as _notify] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:67:449)
at Object.enter (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:70:778)
at n.Class.derive._oncancel._run (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:72:573)
at n.Class.derive._oncancel._completed (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:72:14)
at c (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:75:460)
at n.Class.derive.join.i.forEach.q.then.o.(anonymous function) (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:75:674)
at Object.g [as _notify] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:67:449)
at Object.enter (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:70:778)
at n.Class.derive._oncancel._run (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:72:573)
at n.Class.derive._oncancel._completed (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:72:14)

@brettcannon brettcannon added awaiting 1-verification bug Issue identified by VS Code Team member as probable bug labels Dec 15, 2017
@DonJayamanne
Copy link

@viewstar000 Please could you try uninstalling and re-installing the extension.

@brettcannon brettcannon added info-needed Issue requires more information from poster and removed awaiting 1-verification labels Dec 15, 2017
@toplinuxsir
Copy link

I have experienced the same problem and ,
re-installing the extension doese not work !
vscode version: 1.9.0
ms python extension: 0.9

@DonJayamanne
Copy link

@toplinuxsir
Thats odd, in issue #427 you claim to have version 0.9 installed and don't have this issue?
Please could you update the issue (#427) with the errors logged in your console window.

I'd like to know whether you're experiencing the same issue or not, right now I'm confused with the information you have provided.

@ghost
Copy link

ghost commented Dec 16, 2017

Does this provide something? startup is set to false.

{
	"activationTimes": {
		"startup": false,
		"codeLoadingTime": 1,
		"activateCallTime": 0,
		"activateResolvedTime": 0,
		"activationEvent": "onLanguage:python"
	}
}

@toplinuxsir
Copy link

toplinuxsir commented Dec 16, 2017

@DonJayamanne
Yesterday at company, different computer, Today is Saturday ,At home ,
My home computer has just experienced the problem , But when I re-installing the vscode and python extension, It works

@DonJayamanne
Copy link

DonJayamanne commented Dec 16, 2017

@SShehriyar
Are you also experiencing this same issue.

  • Please confirm you have updated both VS Code and the extension to the latest version.
  • Have you tried reinstalling the extension.

@ghost
Copy link

ghost commented Dec 16, 2017

@DonJayamanne Yes, I ran into this yesterday after updating VS Code to 1.19. I can confirm that I'm running the latest versions of both of them (1.19.0, 0.9.0). I have tried reinstalling the extension but the error persists. Running any command of the extension just gives an Error saying command 'python.command' not found and @viewstar000 has already provided the logs.

@ghost
Copy link

ghost commented Dec 16, 2017

@DonJayamanne I had Visual Studio Code Tools for AI extension installed. It also had some error messages in the developer tools console log. I uninstalled it and the python extension is now working.

EDIT: Can confirm Visual Studio Code Tools for AI extension is causing the python extension to not work (for me) as i uninstalled it and the python extension worked and when i reinstalled it the python extension does not work. Might have something to do with the fact that the AI tools extension isn't supported on linux I believe.

@DonJayamanne
Copy link

@SShehriyar thanks for that information, will look into this. Thanks

@DonJayamanne
Copy link

@viewstar000 do you too have the same VS Code Tools for AI extension installed?
Either way, please could you try disabling ALL extensions except for the Python extension and retrying.

@alex1987chn
Copy link

well, i have encountered the same issue, i have also installed the AI extension, and then the python extension was not working.
thanks @SShehriyar that when i uninstalled the AI extension ,run python file in terminal come back, LOL

@DonJayamanne
Copy link

@alex1987chn Please could you confirm you too have the VS Code Tools for AI extension installed.
If you don't, please could you provide us a list of the extensions you have installed:
You could get a list using the following command line:
code --list-extensions

@viewstar000
Copy link
Author

@DonJayamanne I had installed VS Code Tools for AI extension before. I have uninstalled it just now, the python extension works.

@alex1987chn
Copy link

yes i had installed the VSC AI extension, after the uninstallation of AI extension, the python extension works
@DonJayamanne

@DonJayamanne
Copy link

Thanks everyone

@DonJayamanne DonJayamanne reopened this Dec 18, 2017
@DonJayamanne
Copy link

Reopening as we'll need to implement a fix in the extension to ensure we don't do the same thing to other extensions. (conditionally import reflect-metadata).

@DonJayamanne DonJayamanne added this to the January 2018 milestone Dec 18, 2017
DonJayamanne added a commit that referenced this issue Dec 19, 2017
* Conditionally import `reflect-metadata` (fixes #432)
    * Once within the extension  
    * Once within the debugger  
    * Once within the unittests  
* Fully qualify the `path` module (fixes #454)
@DonJayamanne DonJayamanne removed this from the January 2018 milestone Dec 19, 2017
@DonJayamanne
Copy link

Released in 0.9.1

@brettcannon brettcannon added this to the December 2017 milestone Dec 19, 2017
DonJayamanne added a commit that referenced this issue Dec 19, 2017
* Conditionally import `reflect-metadata` (fixes #432)
    * Once within the extension  
    * Once within the debugger  
    * Once within the unittests  
* Fully qualify the `path` module (fixes #454)
* Update change log for release (#457)
@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
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

5 participants