Can not use Wolfram Kernel when using Local Server
See original GitHub issueThis issue is maybe related to #4041. However I want to connect to Wolfram Kernel with LOCAL server.
Environment data
- VS Code version: 1.59.1(user setup)
- Jupyter Extension version (available under the Extensions sidebar): v2021.8.1236758218
- Python Extension version (available under the Extensions sidebar):v2021.8.1159798656
- OS (Windows | Mac | Linux distro) and version: Windows_NT x64 10.0.19043
- Python and/or Anaconda version: 3.9.4
- Jupyter server running: Local
Expected behaviour
Connecting to Wolfram Kernel and doing calculation (just like on remote server):
Actual behaviour
Can not connect to Wolfram Server:
Steps to reproduce:
- install wolfram engine and wolfram language for jupyter, and operate as what he says. 2.test: success.
- create a new jupyter notebook (.ipynb) and choose “local” server (Default), then choose Wolfram Language 12.3(Maybe you need restart VSCode)
- input
$Version
then run code.
However there is nothing wrong when I connect to remote server. But I think it is troublesome to connect to remote server every time I use it (As is said in #4041).
Logs
output
Info 2021-08-29 22:16:22: Execute Cells request 1 0 Info 2021-08-29 22:16:22: Execute Cell 0 file:///d%3A/1-PRIVATE/P-program/python/new-py-notebook/.ipynb_checkpoints/Wolfram-test-checkpoint-checkpoint.ipynb Info 2021-08-29 22:16:22: Cell Index:0, state:1, exec: undefined. User queued cell for execution Info 2021-08-29 22:16:22: Starting Notebook in kernel.ts id = .wolframlanguage12.3.D:\0-SOFTWARE\Wolfram Research\Wolfram Engine\12.3\wolfram.exe..d:\0-software\wolfram research\wolfram engine\12.3\wolfram.exe#-script#c:\users\zhaoyifei5053\appdata\roaming\wolframengine\paclets\repository\wolframlanguageforjupyter-0.9.2\resources\kernelforwolframlanguageforjupyter.wl#{connection_file} Info 2021-08-29 22:16:22: Creating raw notebook for file:///d%3A/1-PRIVATE/P-program/python/new-py-notebook/.ipynb_checkpoints/Wolfram-test-checkpoint-checkpoint.ipynb Info 2021-08-29 22:16:22: Getting preferred kernel for file:///d%3A/1-PRIVATE/P-program/python/new-py-notebook/.ipynb_checkpoints/Wolfram-test-checkpoint-checkpoint.ipynb Info 2021-08-29 22:16:22: Computing working directory file:///d%3A/1-PRIVATE/P-program/python/new-py-notebook/.ipynb_checkpoints/Wolfram-test-checkpoint-checkpoint.ipynb Info 2021-08-29 22:16:22: Connecting to raw session for file:///d%3A/1-PRIVATE/P-program/python/new-py-notebook/.ipynb_checkpoints/Wolfram-test-checkpoint-checkpoint.ipynb with connection {"kind":"startUsingKernelSpec","kernelSpec":{"specFile":"C:\\Users\\zhaoyifei5053\\AppData\\Roaming\\jupyter\\kernels\\wolframlanguage12.3\\kernel.json","name":"wolframlanguage12.3","argv":["D:\\0-SOFTWARE\\Wolfram Research\\Wolfram Engine\\12.3\\wolfram.exe","-script","C:\\Users\\zhaoyifei5053\\AppData\\Roaming\\WolframEngine\\Paclets\\Repository\\WolframLanguageForJupyter-0.9.2\\Resources\\KernelForWolframLanguageForJupyter.wl","{connection_file}"],"language":"Wolfram Language","path":"D:\\0-SOFTWARE\\Wolfram Research\\Wolfram Engine\\12.3\\wolfram.exe","display_name":"Wolfram Language 12.3"},"id":".wolframlanguage12.3.D:\\0-SOFTWARE\\Wolfram Research\\Wolfram Engine\\12.3\\wolfram.exe..d:\\0-software\\wolfram research\\wolfram engine\\12.3\\wolfram.exe#-script#c:\\users\\zhaoyifei5053\\appdata\\roaming\\wolframengine\\paclets\\repository\\wolframlanguageforjupyter-0.9.2\\resources\\kernelforwolframlanguageforjupyter.wl#{connection_file}"} Info 2021-08-29 22:16:22: Starting raw kernel Wolfram Language 12.3 Info 2021-08-29 22:16:22: Kernel launching with ports 9016,9017,9018,9019,9020. Start port is 9000 Info 2021-08-29 22:16:22: Launching Raw Kernel & not daemon Wolfram Language 12.3 # D:\0-SOFTWARE\Wolfram Research\Wolfram Engine\12.3\wolfram.exe Info 2021-08-29 22:16:22: Cached data exists getEnvironmentVariables, d:\1-PRIVATE\P-program\python\new-py-notebook\.ipynb_checkpoints\Wolfram-test-checkpoint-checkpoint.ipynb Info 2021-08-29 22:16:22: No custom variables for Kernel as interpreter path is not defined for kernel Wolfram Language 12.3 Info 2021-08-29 22:16:22: Process Execution: > D:\0-SOFTWARE\Wolfram Research\Wolfram Engine\12.3\wolfram.exe -script ~\AppData\Roaming\WolframEngine\Paclets\Repository\WolframLanguageForJupyter-0.9.2\Resources\KernelForWolframLanguageForJupyter.wl C:\Users\ZHAOYI~1\AppData\Local\Temp\tmp-52723FjnkllTcoK8.json > D:\0-SOFTWARE\Wolfram Research\Wolfram Engine\12.3\wolfram.exe -script ~\AppData\Roaming\WolframEngine\Paclets\Repository\WolframLanguageForJupyter-0.9.2\Resources\KernelForWolframLanguageForJupyter.wl C:\Users\ZHAOYI~1\AppData\Local\Temp\tmp-52723FjnkllTcoK8.json Info 2021-08-29 22:16:22: Process Execution: cwd: d:\1-PRIVATE\P-program\python\new-py-notebook\.ipynb_checkpoints cwd: d:\1-PRIVATE\P-program\python\new-py-notebook\.ipynb_checkpoints Info 2021-08-29 22:16:22: Launching kernel in kernelProcess.ts, Class name = b, completed in 4ms, has a truthy return value, Arg 1: "d:\\1-PRIVATE\\P-program\\python\\new-py-notebook\\.ipynb_checkpoints", Return Value: {"proc":{"_events":{},"_eventsCount":0,"_closesNeeded":3,"_closesGot":0,"connected":false,"signalCode":null,"exitCode":null,"killed":false,"spawnfile":"D:\\0-SOFTWARE\\Wolfram Research\\Wolfram Engine\\12.3\\wolfram.exe","_handle":{"pid":13892},"spawnargs":["D:\\0-SOFTWARE\\Wolfram Research\\Wolfram Engine\\12.3\\wolfram.exe","-script","C:\\Users\\zhaoyifei5053\\AppData\\Roaming\\WolframEngine\\Paclets\\Repository\\WolframLanguageForJupyter-0.9.2\\Resources\\KernelForWolframLanguageForJupyter.wl","C:\\Users\\ZHAOYI~1\\AppData\\Local\\Temp\\tmp-52723FjnkllTcoK8.json"],"pid":13892,"stdin":{"connecting":false,"_hadError":false,"_parent":null,"_host":null,"_readableState":{"objectMode":false,"highWaterMark":16384,"buffer":{"head":null,"tail":null,"length":0},"length":0,"pipes":[],"flowing":null,"ended":false,"endEmitted":false,"reading":false,"sync":true,"needReadable":false,"emittedReadable":false,"readableListening":false,"resumeScheduled":false,"errorEmitted":false,"emitClose":false,"autoDestroy":false,"destroyed":false,"errored":null,"closed":false,"closeEmitted":false,"defaultEncoding":"utf8","awaitDrainWriters":null,"multiAwaitDrain":false,"readingMore":false,"decoder":null,"encoding":null,"readable":false},"_events":{},"_eventsCount":1,"_writableState":{"objectMode":false,"highWaterMark":16384,"finalCalled":false,"needDrain":false,"ending":false,"ended":false,"finished":false,"destroyed":false,"decodeStrings":false,"defaultEncoding":"utf8","length":0,"writing":false,"corked":0,"sync":true,"bufferProcessing":false,"writecb":null,"writelen":0,"afterWriteTickInfo":null,"buffered":[],"bufferedIndex":0,"allBuffers":true,"allNoop":true,"pendingcb":0,"prefinished":false,"errorEmitted":false,"emitClose":false,"autoDestroy":false,"errored":null,"closed":false,"closeEmitted":false},"allowHalfOpen":false,"_sockname":null,"_pendingData":null,"_pendingEncoding":"","server":null,"_server":null},"stdout":{"connecting":false,"_hadError":false,"_parent":null,"_host":null,"_readableState":{"objectMode":false,"highWaterMark":16384,"buffer":{"head":null,"tail":null,"length":0},"length":0,"pipes":[],"flowing":null,"ended":false,"endEmitted":false,"reading":true,"sync":false,"needReadable":true,"emittedReadable":false,"readableListening":false,"resumeScheduled":false,"errorEmitted":false,"emitClose":false,"autoDestroy":false,"destroyed":false,"errored":null,"closed":false,"closeEmitted":false,"defaultEncoding":"utf8","awaitDrainWriters":null,"multiAwaitDrain":false,"readingMore":false,"decoder":null,"encoding":null},"_events":{},"_eventsCount":2,"_writableState":{"objectMode":false,"highWaterMark":16384,"finalCalled":false,"needDrain":false,"ending":false,"ended":false,"finished":false,"destroyed":false,"decodeStrings":false,"defaultEncoding":"utf8","length":0,"writing":false,"corked":0,"sync":true,"bufferProcessing":false,"writecb":null,"writelen":0,"afterWriteTickInfo":null,"buffered":[],"bufferedIndex":0,"allBuffers":true,"allNoop":true,"pendingcb":0,"prefinished":false,"errorEmitted":false,"emitClose":false,"autoDestroy":false,"errored":null,"closed":false,"writable":false,"closeEmitted":false},"allowHalfOpen":false,"_sockname":null,"_pendingData":null,"_pendingEncoding":"","server":null,"_server":null},"stderr":{"connecting":false,"_hadError":false,"_parent":null,"_host":null,"_readableState":{"objectMode":false,"highWaterMark":16384,"buffer":{"head":null,"tail":null,"length":0},"length":0,"pipes":[],"flowing":null,"ended":false,"endEmitted":false,"reading":true,"sync":false,"needReadable":true,"emittedReadable":false,"readableListening":false,"resumeScheduled":false,"errorEmitted":false,"emitClose":false,"autoDestroy":false,"destroyed":false,"errored":null,"closed":false,"closeEmitted":false,"defaultEncoding":"utf8","awaitDrainWriters":null,"multiAwaitDrain":false,"readingMore":false,"decoder":null,"encoding":null},"_events":{},"_eventsCount":2,"_writableState":{"objectMode":false,"highWaterMark":16384,"finalCalled":false,"needDrain":false,"ending":false,"ended":false,"finished":false,"destroyed":false,"decodeStrings":false,"defaultEncoding":"utf8","length":0,"writing":false,"corked":0,"sync":true,"bufferProcessing":false,"writecb":null,"writelen":0,"afterWriteTickInfo":null,"buffered":[],"bufferedIndex":0,"allBuffers":true,"allNoop":true,"pendingcb":0,"prefinished":false,"errorEmitted":false,"emitClose":false,"autoDestroy":false,"errored":null,"closed":false,"writable":false,"closeEmitted":false},"allowHalfOpen":false,"_sockname":null,"_pendingData":null,"_pendingEncoding":"","server":null,"_server":null},"stdio":[{"connecting":false,"_hadError":false,"_parent":null,"_host":null,"_readableState":{"objectMode":false,"highWaterMark":16384,"buffer":{"head":null,"tail":null,"length":0},"length":0,"pipes":[],"flowing":null,"ended":false,"endEmitted":false,"reading":false,"sync":true,"needReadable":false,"emittedReadable":false,"readableListening":false,"resumeScheduled":false,"errorEmitted":false,"emitClose":false,"autoDestroy":false,"destroyed":false,"errored":null,"closed":false,"closeEmitted":false,"defaultEncoding":"utf8","awaitDrainWriters":null,"multiAwaitDrain":false,"readingMore":false,"decoder":null,"encoding":null,"readable":false},"_events":{},"_eventsCount":1,"_writableState":{"objectMode":false,"highWaterMark":16384,"finalCalled":false,"needDrain":false,"ending":false,"ended":false,"finished":false,"destroyed":false,"decodeStrings":false,"defaultEncoding":"utf8","length":0,"writing":false,"corked":0,"sync":true,"bufferProcessing":false,"writecb":null,"writelen":0,"afterWriteTickInfo":null,"buffered":[],"bufferedIndex":0,"allBuffers":true,"allNoop":true,"pendingcb":0,"prefinished":false,"errorEmitted":false,"emitClose":false,"autoDestroy":false,"errored":null,"closed":false,"closeEmitted":false},"allowHalfOpen":false,"_sockname":null,"_pendingData":null,"_pendingEncoding":"","server":null,"_server":null},{"connecting":false,"_hadError":false,"_parent":null,"_host":null,"_readableState":{"objectMode":false,"highWaterMark":16384,"buffer":{"head":null,"tail":null,"length":0},"length":0,"pipes":[],"flowing":null,"ended":false,"endEmitted":false,"reading":true,"sync":false,"needReadable":true,"emittedReadable":false,"readableListening":false,"resumeScheduled":false,"errorEmitted":false,"emitClose":false,"autoDestroy":false,"destroyed":false,"errored":null,"closed":false,"closeEmitted":false,"defaultEncoding":"utf8","awaitDrainWriters":null,"multiAwaitDrain":false,"readingMore":false,"decoder":null,"encoding":null},"_events":{},"_eventsCount":2,"_writableState":{"objectMode":false,"highWaterMark":16384,"finalCalled":false,"needDrain":false,"ending":false,"ended":false,"finished":false,"destroyed":false,"decodeStrings":false,"defaultEncoding":"utf8","length":0,"writing":false,"corked":0,"sync":true,"bufferProcessing":false,"writecb":null,"writelen":0,"afterWriteTickInfo":null,"buffered":[],"bufferedIndex":0,"allBuffers":true,"allNoop":true,"pendingcb":0,"prefinished":false,"errorEmitted":false,"emitClose":false,"autoDestroy":false,"errored":null,"closed":false,"writable":false,"closeEmitted":false},"allowHalfOpen":false,"_sockname":null,"_pendingData":null,"_pendingEncoding":"","server":null,"_server":null},{"connecting":false,"_hadError":false,"_parent":null,"_host":null,"_readableState":{"objectMode":false,"highWaterMark":16384,"buffer":{"head":null,"tail":null,"length":0},"length":0,"pipes":[],"flowing":null,"ended":false,"endEmitted":false,"reading":true,"sync":false,"needReadable":true,"emittedReadable":false,"readableListening":false,"resumeScheduled":false,"errorEmitted":false,"emitClose":false,"autoDestroy":false,"destroyed":false,"errored":null,"closed":false,"closeEmitted":false,"defaultEncoding":"utf8","awaitDrainWriters":null,"multiAwaitDrain":false,"readingMore":false,"decoder":null,"encoding":null},"_events":{},"_eventsCount":2,"_writableState":{"objectMode":false,"highWaterMark":16384,"finalCalled":false,"needDrain":false,"ending":false,"ended":false,"finished":false,"destroyed":false,"decodeStrings":false,"defaultEncoding":"utf8","length":0,"writing":false,"corked":0,"sync":true,"bufferProcessing":false,"writecb":null,"writelen":0,"afterWriteTickInfo":null,"buffered":[],"bufferedIndex":0,"allBuffers":true,"allNoop":true,"pendingcb":0,"prefinished":false,"errorEmitted":false,"emitClose":false,"autoDestroy":false,"errored":null,"closed":false,"writable":false,"closeEmitted":false},"allowHalfOpen":false,"_sockname":null,"_pendingData":null,"_pendingEncoding":"","server":null,"_server":null}]},"out":{"_isScalar":false}} Error 2021-08-29 22:17:22: Disposing kernel process due to an error [Error: timeout at Timeout.<anonymous> (c:\Users\zhaoyifei5053\.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:52:778412) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)] Info 2021-08-29 22:17:22: Dispose Kernel process Error 2021-08-29 22:17:22: Timed out waiting to get a heartbeat from kernel process. Error 2021-08-29 22:17:22: Raw session failed to start in given timeout Info 2021-08-29 22:17:22: Shutdown session -- complete Error 2021-08-29 22:17:22: failed to create INotebook in kernel, UI Disabled = false [_ [Error]: at new o (c:\Users\zhaoyifei5053\.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:16:23818) at new _ (c:\Users\zhaoyifei5053\.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:37:549497) at w.connect (c:\Users\zhaoyifei5053\.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:37:551353) at async E.createNotebookInstance (c:\Users\zhaoyifei5053\.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:90:454182)Error: 等待内核进程响应超时。 jupyter.viewOutput 查看 Jupyter 日志了解更多细节。 at b.launch (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:52:773225)] { category: ‘timeout’, originalException: [i [Error]: 等待内核进程响应超时。 jupyter.viewOutput 查看 Jupyter 日志了解更多细节。 at b.launch (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:52:773225)] { category: ‘timeout’ } } Error 2021-08-29 22:17:22: DataScience Error [i [Error]: 等待内核进程响应超时。 jupyter.viewOutput 查看 Jupyter 日志了解更多细节。 at b.launch (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:52:773225)] { category: ‘timeout’ } Error 2021-08-29 22:17:22: failed to start INotebook in kernel, UI Disabled = false [_ [Error]: at new o (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:16:23818) at new _ (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:37:549497) at w.connect (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:37:551353) at async E.createNotebookInstance (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:90:454182)
Error: 等待内核进程响应超时。 jupyter.viewOutput 查看 Jupyter 日志了解更多细节。 at b.launch (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:52:773225)] { category: ‘timeout’, originalException: [i [Error]: 等待内核进程响应超时。 jupyter.viewOutput 查看 Jupyter 日志了解更多细节。 at b.launch (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:52:773225)] { category: ‘timeout’ } } Error 2021-08-29 22:17:22: Failed to execute cells in CellExecutionQueue [_ [Error]: at new o (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:16:23818) at new _ (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:37:549497) at w.connect (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:37:551353) at async E.createNotebookInstance (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:90:454182)
Error: 等待内核进程响应超时。 jupyter.viewOutput 查看 Jupyter 日志了解更多细节。 at b.launch (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:52:773225)] { category: ‘timeout’, originalException: [i [Error]: 等待内核进程响应超时。 jupyter.viewOutput 查看 Jupyter 日志了解更多细节。 at b.launch (c:\Users\zhaoyifei5053.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:52:773225)] { category: ‘timeout’ } } Info 2021-08-29 22:17:22: Cancel pending cells Info 2021-08-29 22:17:22: Cell Index:0, state:2, exec: undefined. Execution cancelled Info 2021-08-29 22:17:22: Cell Index:0, state:2, exec: undefined. Completed due to cancellation Info 2021-08-29 22:17:22: Cell Index:0, state:2, exec: undefined. Cell cancelled & resolving Info 2021-08-29 22:17:22: Cell Index:0, state:2, exec: undefined. Execution disposed Info 2021-08-29 22:17:22: KernelProcess Exit Exit - undefined
Thanks!!
Issue Analytics
- State:
- Created 2 years ago
- Comments:26 (13 by maintainers)
Top GitHub Comments
Hi @DavidKutu
Wolfram Engine
is 12.31+1
and runJupyter Lab
(it will give you the URL of the server), then paste the URL in VS code (chose remote Jupyter server)To make sure you can repeat this problem on your computer, I have written the installation in detail. All the installation and setups may take you 15 mins.
First, you need to install the
Wolfram Engine
; it is free, but you need to create a Wolfram ID to get a license. TheWolfram Engine
is about 1 GB.Wolfram Engine
at https://www.wolfram.com/engine/ (I’m running it on Windows)You can type
wolframscript.exe
in your PowerShell or Command Prompt to openWolfram Engine
and run1+1
in it, it should return you2
. TypeExit
to quit. Here is the example run on my computer(I believe you have installed
Jupyter Lab
, if not, you can directly installconda
and runconda install jupyterlab
.)Then, you need the
WolframLanguageForJupyter
here, I think “Method 1” suits you. It may takes you 2 mins..\configure-jupyter.wls add
at the path you chose. (note that if yourJupyter Lab
is installed by conda, remember to run this at the same environment ofJupyter Lab
)Now, you should be able to chose
Wolfram Language 12.3
as the kernel in an.ipynb
file opened byJupyter Lab
or VS code. You can run1+1
again after choseWolfram Language 12.3
as the kernel. I believe you will see what @yfzhao20 described above.If you need any more information, let me know.
@ted1277 I’ve added the fix, it should in in tomorrows insider version of the extension. Please install VS Code Insiders and you’ll get the fix (we’ll ship this in the next stable version of the extension)