Skip to content

Unable to set Python Interpreter - Error command 'python.setInterpreter' not found #568

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
victorhooi opened this issue Jan 11, 2018 · 16 comments
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@victorhooi
Copy link

Environment data

VS Code version: Version 1.20.0-insider (1.20.0-insider), f4ed56b
Python Extension version: 0.9.1
Python Version: 2.7.10
OS and version: OSX 10.12.6

Actual behavior

Pressing Command + Shift + P, and then selecting the "Python: Select Interpreter" command

Error message appears at top:

Error command 'python.setInterpreter' not found

screen shot 2018-01-11 at 13 38 12

Expected behavior

The "Python: Select Interpreter" should allow you to pick a Python interpreter, rather than returning an error message.

Steps to reproduce:

  • Start up VS Code.
  • Press Command + Shift + P
  • Type in "python select", then select the first result ("Python: Select Interpreter")

Logs

Output from Python output panel

I'm not sure where this Python output panel is?

Output from Console window (Help->Developer Tools menu)

workbench.main.js:sourcemap:2618 [Extension Host] debugger listening on port 9334
workbench.main.js:sourcemap:2616 [Extension Host] debugger inspector at %cDebugger listening on port 9334.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
    chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9334/518ad386-7993-4474-a42e-82c7566ba4da

workbench.main.js:sourcemap:253 [Extension Host] Activating extension `ms-python.python` failed: Cannot find module '/Users/victorhooi/.vscode-insiders/extensions/ms-python.python-0.9.1/out/client/extension'. (at Object.showMessage (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:508:200))
t.log @ workbench.main.js:sourcemap:253
workbench.main.js:sourcemap:253 [Extension Host] Activating extension `ms-python.python` failed:  Cannot find module '/Users/victorhooi/.vscode-insiders/extensions/ms-python.python-0.9.1/out/client/extension' (at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:293:87)
t.log @ workbench.main.js:sourcemap:253
workbench.main.js:sourcemap:253 [Extension Host] Here is the error stack:  Error: Cannot find module '/Users/victorhooi/.vscode-insiders/extensions/ms-python.python-0.9.1/out/client/extension'
	at Function.Module._resolveFilename (module.js:470:15)
	at Function.Module._load (module.js:418:25)
	at Function.J.Y.t.getExtensionPathIndex.then.o._load (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:490:787)
	at Module.require (module.js:498:17)
	at require (internal/module.js:20:19)
	at Function.a [as __$__nodeRequire] (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/loader.js:31:863)
	at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:511:186
	at t._doActivateExtension (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:511:298)
	at t._activateExtension (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:510:233)
	at Object.actualActivateExtension (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:508:332) (at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:293:155)
workbench.main.js:sourcemap:4118 Activating extension `ms-python.python` failed: Cannot find module '/Users/victorhooi/.vscode-insiders/extensions/ms-python.python-0.9.1/out/client/extension'.
t._logMessageInConsole @ workbench.main.js:sourcemap:4118
workbench.main.js:sourcemap:2821 command 'python.setInterpreter' not found
e.doShow @ workbench.main.js:sourcemap:2821
workbench.main.js:sourcemap:1248  INFO Requested uninstalling the extension ms-python.python from window 3
workbench.main.js:sourcemap:1248  INFO Uninstalling the extension ms-python.python-0.9.1 from window 3
workbench.main.js:sourcemap:1248  INFO showMessageBox begin:  Object {message: "Are you sure you want to uninstall 'Python'?", buttons: Array(2), type: "question", cancelId: 1, noLink: true…}
workbench.main.js:sourcemap:1248  INFO showMessageBox closed, response:  Object {button: 0, checkboxChecked: false}
workbench.main.js:sourcemap:2821 command 'python.setInterpreter' not found
e.doShow @ workbench.main.js:sourcemap:2821
e.show @ workbench.main.js:sourcemap:2820
e.resume @ workbench.main.js:sourcemap:2820
(anonymous) @ workbench.main.js:sourcemap:4505
e.fire @ workbench.main.js:sourcemap:160
(anonymous) @ workbench.main.js:sourcemap:3292

I have tried uninstalling and reinstalling both VSCode Insiders, as well as the Python extension.

I saw this similar issue - https://github.com/DonJayamanne/pythonVSCode/issues/1394 - but reinstalling didn't fix it in this instance, and no explanation was given on that issue of the underlying issue.

@DonJayamanne
Copy link

Please could you try disabling all except this extension and trying once again. The extension isn't loading for some reason.

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster feature-extension labels Jan 11, 2018
@HymanZHAN
Copy link

I encountered this problem just a few min ago as well but could not find which extension is interfering. A simple reinstall fixed the problem though, at least temporarily.

@DonJayamanne
Copy link

I'm closing this issue due to inactivity. If you are still able to replicate this issue, then please ry disabling all except this extension and trying once again and re-open the issue.

@DonJayamanne DonJayamanne added closed-invalid and removed info-needed Issue requires more information from poster labels Feb 1, 2018
@spipes
Copy link

spipes commented Feb 2, 2018

Can (currently) recreate. No error when disabling all other extensions.

@brettcannon brettcannon added info-needed Issue requires more information from poster and removed awaiting 1-decision labels Feb 2, 2018
@brettcannon
Copy link
Member

@spipes can you include the information we request in the issue template?

@spipes
Copy link

spipes commented Feb 2, 2018

Environment data

VS Code version: 1.19.3
Python Extension version: 2018.1
Python Version: Python 3.5.2 :: Continuum Analytics, Inc.
OS and version: Windows 7

Actual behavior

[As above]

Expected behavior

Steps to reproduce:

[As above]

Logs

Output from Python output panel
[No output
]
Output from Console window (Help->Developer Tools menu)

[Extension Host] Activating extension `ms-python.python` failed: Missing required @injectable annotation in: PlatformService..
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:249
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] Activating extension `ms-python.python` failed:  Missing required @injectable annotation in: PlatformService.
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:249


[Extension Host] Here is the error stack:  Error: Missing required @injectable annotation in: PlatformService.
	at getTargets (C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\node_modules\inversify\lib\planning\reflection_utils.js:19:15)
	at Object.getDependencies (C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\node_modules\inversify\lib\planning\reflection_utils.js:10:19)
	at C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\node_modules\inversify\lib\planning\planner.js:106:51
	at Array.forEach (native)
	at _createSubRequests (C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\node_modules\inversify\lib\planning\planner.js:94:20)
	at Object.plan (C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\node_modules\inversify\lib\planning\planner.js:129:9)
	at C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\node_modules\inversify\lib\container\container.js:243:37
	at Container._get (C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\node_modules\inversify\lib\container\container.js:236:44)
	at Container.get (C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\node_modules\inversify\lib\container\container.js:195:21)
	at ServiceManager.get (C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\out\client\ioc\serviceManager.js:41:89)
	at Object.registerTypes (C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\out\client\common\platform\serviceRegistry.js:12:24)
	at C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\out\client\extension.js:97:27
	at Generator.next (<anonymous>)
	at C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\out\client\extension.js:7:71
	at Promise (<anonymous>)
	at __awaiter (C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\out\client\extension.js:3:12)
	at activate (C:\Users\spipes\.vscode\extensions\ms-python.python-2018.1.0\out\client\extension.js:78:12)
	at Function.t._callActivateOptional (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:512:370)
	at Function.t._callActivate (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:512:54)
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:511:329
	at Object.g [as _notify] (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:67:449)
	at Object.enter (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:70:778)
	at n.Class.derive._oncancel._run (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:72:573)
	at n.Class.derive._oncancel._completed (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:72:14)
	at c (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:75:460)
	at q.then.o.(anonymous function) (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:75:674)
	at Object.g [as _notify] (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:67:449)
	at Object.enter (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:70:778)
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:249

@DonJayamanne
Copy link

@spipes
Are you able to replicate this issue after disabling all other extensions?

@brettcannon brettcannon reopened this Feb 2, 2018
@spipes
Copy link

spipes commented Feb 2, 2018

No.

@DonJayamanne
Copy link

DonJayamanne commented Feb 2, 2018

Ok, looks like we have an extension out there that's causing the python extension to fall over. Please could you provide a list of the extensions installed. Easiest way to do this is to go into the 'Report an issue' command from the command palette. That'll create an issue on GitHub and prepoulate the list of extensions for you, copy that into this issue.

@spipes
Copy link

spipes commented Feb 2, 2018

Python and Visual Studio Code Tools for AI are enabled. If I disable the latter, the problem goes away.

@DonJayamanne
Copy link

Please could yo ensure you have the latest versions of both extensions.

@DonJayamanne
Copy link

The problem is with the Visual Studio Code Tools for AI. I've filed an issue here microsoft/vscode-tools-for-ai#18 (comment)

I'm closing this issue as the problem lies with the other (AI) extension.

@hargikas
Copy link

hargikas commented Mar 9, 2018

I am on windows machine, I upgraded to the latest version and this problem started to appear.

I uninstalled all other extensions except python and when I am pressing Ctrl + Shift + P, and then selecting the "Python: Select Interpreter" command

I get: Error command 'python.setInterpreter' not found

@brettcannon
Copy link
Member

@hargikas please open a new issue

@flerxu
Copy link

flerxu commented Mar 12, 2018

I am using 1.21.0 on debian machine. Reinstallation or reset did not help.

@microsoft microsoft locked as resolved and limited conversation to collaborators Mar 12, 2018
@brettcannon
Copy link
Member

If people have issues with the automatic updating then please completely uninstall the Python extension, close VS Code, open it again, and then try installing the extension. If that doesn't work then please open a new issue.

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 info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

7 participants