Skip to content

Python Launcher does not work for Python terminal or Python Interactive window #3619

@bcoov

Description

@bcoov

Environment data

  • VS Code version: 1.31.0
  • Extension version (available under the Extensions sidebar): 2019.1.0
  • OS and version: Windows 7 Enterprise SP1, 64-bit
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.2 32-bit & Python 2.7.14 64-bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: (Python 3) jupyter-notebook 5.7.4; (Python 2) jupyter-notebook 5.2.2

Expected behaviour

Clicking "Run-Cell" above a note-book enabled snippet starts and runs Jupyter Notebook

Actual behaviour

Clicking "Run-Cell" triggers an error stating "Executing code failed : Error: Running cells requires Jupyter notebooks to be installed."

Running py -m notebook from a cmd window and/or VSCode's terminal starts jupyter notebook as expected for Python 3 and similarly py -2 -m notebook for Python 2.

Steps to reproduce:

  1. Have at least Python 3 (for the launcher) installed using default options (Python Launcher on PATH, Python Executable not on PATH) and with jupyter-notebook module installed. Have no other versions of Python on PATH, only the launcher (C:\Windows\py.exe)
  2. Select Python 3.x as interpreter.
  3. Create a simple notebook snippet and try to run the cells
#%%
msg = "Hello World"
print(msg)

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Starting Jedi Python language engine.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

console.ts:134 [Extension Host] Python Extension: Cached data exists ActivatedEnvironmentVariables, <No Resource>

console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>

console.ts:134 [Extension Host] Python Extension: getActivatedEnvironmentVariables, Class name = S, Arg 1: undefined, Arg 2: {"architecture":2,"path":"C:\\Python37-32\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37-32","fileHash":"d84cbeced9380942287d24afb8ff1ca2b1eb881dd92e80f1e21a101cdf2c4f2aa28a2629baad07c6dbd1528b0bc445f6d2a52c9cd30baf402a76b89c82ecdd0b","companyDisplayName":"Python Software Foundation","type":"Unknown","displayName":"Python 3.7.2 32-bit"}

console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>

console.ts:134 [Extension Host] Python Extension: Activation Commands received undefined

console.ts:134 [Extension Host] Python Extension: getActivatedEnvironmentVariables, Class name = S, Arg 1: undefined, Arg 2: {"architecture":3,"path":"C:\\Python27\\python.exe","version":{"raw":"2.7.14-final","major":2,"minor":7,"patch":14,"prerelease":["final"],"build":[],"version":"2.7.14-final"},"sysPrefix":"C:\\Python27","fileHash":"45320b6ecc01ba85d63e7b3a68c02dfe545da607d62447b640dab7cdc589e0b7f087fd3a5b48c27eb06c6b9a9bda6a2326bf1e62e8b4c2d83f1ea190ec714a12","companyDisplayName":"Python Software Foundation","type":"Unknown","displayName":"Python 2.7.14 64-bit"}

console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>

console.ts:134 [Extension Host] Python Extension: Error: Error executing Jupyter command 'notebook': [Errno 'jupyter-notebook' not found] 2
 for C:\Python27\python.exe
t.log @ console.ts:134
e.$logExtensionHostMessage @ mainThreadConsole.ts:39
t._doInvokeHandler @ rpcProtocol.ts:390
t._invokeHandler @ rpcProtocol.ts:375
t._receiveRequest @ rpcProtocol.ts:295
t._receiveOneMessage @ rpcProtocol.ts:225
(anonymous) @ rpcProtocol.ts:100
e.fire @ event.ts:567
s @ ipc.net.ts:295
(anonymous) @ ipc.net.ts:302
e.fire @ event.ts:567
a @ ipc.net.ts:103
_socketDataListener @ ipc.net.ts:132
emit @ events.js:182
addChunk @ _stream_readable.js:279
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onread @ net.js:636

console.ts:134 [Extension Host] Python Extension: Error: Error executing Jupyter command 'notebook': [Errno 'jupyter-notebook' not found] 2
 for C:\Python37-32\python.exe
t.log @ console.ts:134
e.$logExtensionHostMessage @ mainThreadConsole.ts:39
t._doInvokeHandler @ rpcProtocol.ts:390
t._invokeHandler @ rpcProtocol.ts:375
t._receiveRequest @ rpcProtocol.ts:295
t._receiveOneMessage @ rpcProtocol.ts:225
(anonymous) @ rpcProtocol.ts:100
e.fire @ event.ts:567
s @ ipc.net.ts:295
(anonymous) @ ipc.net.ts:302
e.fire @ event.ts:567
a @ ipc.net.ts:103
_socketDataListener @ ipc.net.ts:132
emit @ events.js:182
addChunk @ _stream_readable.js:279
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onread @ net.js:636

console.ts:134 [Extension Host] Python Extension: Error: spawn jupyter ENOENT
t.log @ console.ts:134
e.$logExtensionHostMessage @ mainThreadConsole.ts:39
t._doInvokeHandler @ rpcProtocol.ts:390
t._invokeHandler @ rpcProtocol.ts:375
t._receiveRequest @ rpcProtocol.ts:295
t._receiveOneMessage @ rpcProtocol.ts:225
(anonymous) @ rpcProtocol.ts:100
e.fire @ event.ts:567
s @ ipc.net.ts:295
(anonymous) @ ipc.net.ts:302
e.fire @ event.ts:567
a @ ipc.net.ts:103
_socketDataListener @ ipc.net.ts:132
emit @ events.js:182
addChunk @ _stream_readable.js:279
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onread @ net.js:636

notificationsAlerts.ts:40 Executing code failed : Error: Running cells requires Jupyter notebooks to be installed.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions