spawn /usr/bin/python2 ENOENT when trying to select interpreter
See original GitHub issuespawn /usr/bin/python2 ENOENT
Environment data
- VS Code version: 1.21.1
- Extension version (available under the Extensions sidebar): 2018.3.1
- OS and version: Windows 7 (7601)
- Python version (& distribution if applicable, e.g. Anaconda): python.org 3.6.5
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): NA
- Relevant/affected Python packages and their versions: python 3 (as above)
Actual behavior
Step 3 of the prerequisites states:
From within VS Code, select a version of Python using the Python: Select Interpreter command on the Command Palette (Ctrl+Shift+P), or by using the Select Python Environment option on the Status Bar if available
The command presents a list of available interpreters that VS Code can find automatically. If you don’t see the desired interpreter, see Configuring Python environments.
The readme also mentions this under optional steps:
Step 5. Select your preferred Python interpreter/version/environment using the Select Interpreter command.
- By default we use the one that’s on your path.
- If you have a workspace open you can also click in the status bar to change the interpreter.
However, when attempting to select an interpreter, VsCode reports the error:
spawn /usr/bin/python2 ENOENT and nothing further happens.
Expected behavior
The interpreter is selected (or at least a more helpful error message is displayed)
Steps to reproduce:
- Install vscode,
- Install python,
- Ensure python is on path
- Install extension,
- Attempt to select interpreter.
Python install path is known by vscode as selecting Python: Start REPL
, works as expected.
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
##########Linting Output - pylint##########
No config file found, using default configuration
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
)
log.ts:171 ERR spawn /usr/bin/python2 ENOENT: Error: spawn /usr/bin/python2 ENOENT
at exports._errnoException (util.js:1050:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
console.ts:136 [Extension Host] rejected promise not handled within 1 second
t.log @ console.ts:136
t._logExtensionHostMessage @ extensionHost.ts:400
(anonymous) @ extensionHost.ts:213
emitTwo @ events.js:106
emit @ events.js:194
process.nextTick @ internal/child_process.js:766
_combinedTickCallback @ internal/process/next_tick.js:73
_tickCallback @ internal/process/next_tick.js:104
notificationsAlerts.ts:39 spawn /usr/bin/python2 ENOENT
e.onDidNotificationChange @ notificationsAlerts.ts:39
(anonymous) @ notificationsAlerts.ts:28
e.fire @ event.ts:142
e.notify @ notifications.ts:127
e.error @ notificationService.ts:58
t.onError @ commandsHandler.ts:326
(anonymous) @ commandsHandler.ts:311
done @ winjs.base.raw.js:1391
v @ winjs.base.raw.js:1237
enter @ winjs.base.raw.js:914
_run @ winjs.base.raw.js:1081
_error @ winjs.base.raw.js:1054
e.resolveErr @ lazyPromise.ts:78
e._receiveReplyErr @ rpcProtocol.ts:154
e._receiveOneMessage @ rpcProtocol.ts:99
(anonymous) @ rpcProtocol.ts:33
(anonymous) @ rpcProtocol.ts:213
e.fire @ event.ts:142
(anonymous) @ ipc.net.ts:81
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
Issue Analytics
- State:
- Created 5 years ago
- Comments:27 (1 by maintainers)
Top GitHub Comments
Yep, that new version works. As mentioned above the debugger now runs through the shell specified in the setting terminal.integrated.shell.windows, but I’d like to leave that set to bash, which is now causing issues. Is there a way to separate which shell the debugger uses from the shell used in the integrated terminal? Let me know if I should make a separate post or something about this.
Regardless, thanks for the quick fix on this issue.
@bbukaty Here’s a new version of the extension, please test and let me know how this goes. https://pvsc.blob.core.windows.net/extension-builds/python-2018.4.0-alpha-dev2.vsix Thanks