microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.27k stars 279 forks source link

Failed to connect to Jupyter notebook. http://localhost:8888/ Error: Kernel Python 3.8.2 64-bit is not usable #4937

Closed fkhjoy closed 3 years ago

fkhjoy commented 3 years ago

Environment data

Expected behaviour

Connected to local server with Jupyter Output ``` [I 14:29:48.777 NotebookApp] Kernel started: 338c25d0-39b3-4471-ad33-f627d59f74aa, name: python38264bit58e42c9575d24eb58f427896571571af [W 14:29:48.788 NotebookApp] delete /t-b3b6f7a6-c9f1-4c28-84cb-28f8cdabd1df.ipynb [I 14:29:48.820 NotebookApp] Kernel started: 067ec0a0-cc2c-4541-8aff-33a871976ced, name: python38264bit58e42c9575d24eb58f427896571571af [I 14:29:48.837 NotebookApp] Kernel started: f4461f07-e284-4d9a-b1a7-76cac9119f47, name: python38264bit58e42c9575d24eb58f427896571571af [I 14:29:48.850 NotebookApp] Kernel started: 272852be-dc17-4ae8-946b-01975f13b72f, name: python38264bit58e42c9575d24eb58f427896571571af [W 14:29:48.857 NotebookApp] delete /t-09a9a685-7aac-4af9-b7e4-020ea85e2ae7.ipynb [W 14:29:48.873 NotebookApp] delete /t-e90d39e7-d365-4b7a-8b73-be2321f10b02.ipynb [W 14:29:48.882 NotebookApp] delete /t-bf1c6aac-2e4d-4df2-b73c-6fdd12c2be6b.ipynb [I 14:29:49.397 NotebookApp] Creating new notebook in / [I 14:29:49.408 NotebookApp] Creating new notebook in / [I 14:29:49.419 NotebookApp] Creating new notebook in / > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel" > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel" > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel" > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel" > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel" > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel" [I 14:29:49.796 NotebookApp] Kernel started: 3066b5cf-3b26-4e8b-addb-decca5a8f149, name: python38264bit58e42c9575d24eb58f427896571571af [I 14:29:49.807 NotebookApp] Kernel started: d6314ca0-3282-444f-930b-b9af5f0cc30a, name: python38264bit58e42c9575d24eb58f427896571571af [W 14:29:49.812 NotebookApp] delete /t-34ce1030-237e-4f93-9baa-442d3c623a5f.ipynb [W 14:29:49.819 NotebookApp] delete /t-afa95c44-aa2d-4445-b730-166dc4d510dc.ipynb [I 14:29:49.844 NotebookApp] Kernel started: 87b79135-bd17-4fa4-90e3-241b0c055923, name: python38264bit58e42c9575d24eb58f427896571571af [W 14:29:49.850 NotebookApp] delete /t-7d13316e-0052-4d33-9ed9-7dbf07a77c8d.ipynb ```

Actual behaviour

Failed to connect to Jupyter notebook. http://localhost:8888/ Error: Kernel Python 3.8.2 64-bit is not usable with Jupyter Output ``` Starting Jupyter from /usr/bin/python3 with command line --no-browser --notebook-dir="/home/ubuntu/Tasks/Python/stock_amibroker" --config=/tmp/f8410491-94a9-479d-a09c-210cba1fa93d/jupyter_notebook_config.py --NotebookApp.iopub_data_rate_limit=10000000000.0 > /usr/bin/python3 (daemon) -m jupyter notebook --no-browser --notebook-dir="/home/ubuntu/Tasks/Python/stock_amibroker" --config=/tmp/f8410491-94a9-479d-a09c-210cba1fa93d/jupyter_notebook_config.py --NotebookApp.iopub_data_rate_limit=10000000000.0 > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py pip list > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py pip list [I 14:48:10.502 NotebookApp] The port 8888 is already in use, trying another port. [I 14:48:10.503 NotebookApp] Serving notebooks from local directory: /home/ubuntu/Tasks/Python/stock_amibroker [I 14:48:10.503 NotebookApp] Jupyter Notebook 6.2.0 is running at: [I 14:48:10.504 NotebookApp] http://localhost:8889/?token=417186c78c21fdc78626a84360e3d869d320b29270e75a66 > /usr/bin/python3 (daemon) ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/vscode_datascience_helpers/getServerInfo.py [I 14:48:10.504 NotebookApp] or http://127.0.0.1:8889/?token=417186c78c21fdc78626a84360e3d869d320b29270e75a66 > /usr/bin/python3 (daemon) ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/vscode_datascience_helpers/getServerInfo.py [I 14:48:10.504 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 14:48:10.506 NotebookApp] To access the notebook, open this file in a browser: file:///home/ubuntu/.local/share/jupyter/runtime/nbserver-22281-open.html Or copy and paste one of these URLs: http://localhost:8889/?token=417186c78c21fdc78626a84360e3d869d320b29270e75a66 or http://127.0.0.1:8889/?token=417186c78c21fdc78626a84360e3d869d320b29270e75a66 [I 14:48:10.673 NotebookApp] Creating new notebook in / > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel" > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel" > /usr/bin/python3 (daemon) ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/vscode_datascience_helpers/getServerInfo.py > /usr/bin/python3 (daemon) ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/vscode_datascience_helpers/getServerInfo.py [I 14:48:10.997 NotebookApp] Kernel started: 929a4891-8476-4fba-8ea8-daef87f1872d, name: python38264bit58e42c9575d24eb58f427896571571af [W 14:48:11.010 NotebookApp] delete /t-560f0799-3118-4edf-8ceb-35a206222340.ipynb [I 14:48:13.999 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports [I 14:48:17.011 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports [I 14:48:20.023 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports [I 14:48:23.031 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports [W 14:48:26.040 NotebookApp] KernelRestarter: restart failed [W 14:48:26.041 NotebookApp] Kernel 929a4891-8476-4fba-8ea8-daef87f1872d died, removing from map. Error 2021-02-24 14:48:30: Kernel died while waiting for idle Error 2021-02-24 14:48:30: Failed to change kernel [c [Error]: Kernel is not usable. Check the Jupyter output tab for more information. at n (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:9:176843) at r (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:9:176965) at o (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/node_modules/@jupyterlab/services.js:1:57939) at Object.e.emit (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/node_modules/@jupyterlab/services.js:1:57653) at e.emit (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/node_modules/@jupyterlab/services.js:1:55890) at c.dispose (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/node_modules/@jupyterlab/services.js:3:540973) at /home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/node_modules/@jupyterlab/services.js:3:545409 at Object.t.each (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/node_modules/@jupyterlab/services.js:1:63056) at m (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/node_modules/@jupyterlab/services.js:3:545325) at /home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/node_modules/@jupyterlab/services.js:3:544204 at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) at async t.SessionManager.requestRunning (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/node_modules/@jupyterlab/services.js:3:537695)] { category: 'invalidkernel', kernelConnectionMetadata: { kernelModel: { _createSocket: [Function], _onWSOpen: [Function], _onWSMessage: [Function], _onWSClose: [Function], _id: '929a4891-8476-4fba-8ea8-daef87f1872d', _name: 'python38264bit58e42c9575d24eb58f427896571571af', _status: 'dead', _kernelSession: '', _clientId: 'aff3e05c-5df1-4a5c-a77d-99d9398c9dc3', _isDisposed: true, _wsStopped: true, _ws: null, _username: '', _reconnectLimit: 7, _reconnectAttempt: 0, _isReady: false, _readyPromise: [e], _initialized: false, _futures: Map {}, _comms: Map {}, _targetRegistry: [Object: null prototype] {}, _info: null, _pendingMessages: [], _statusChanged: [e], _iopubMessage: [e], _anyMessage: [e], _unhandledMessage: [e], _displayIdToParentIds: Map {}, _msgIdToDisplayIds: Map {}, _terminated: [e], _msgChain: null, _noOp: [Function], serverSettings: [Object], handleComms: true, lastActivityTime: 2021-02-24T08:48:30.709Z, numberOfConnections: 0, session: [Object] }, kind: 'connectToLiveKernel' } } Error 2021-02-24 14:48:30: Failed to connect to server [c [Error]: Kernel Python 3.8.2 64-bit is not usable. Check the Jupyter output tab for more information. at w.createNewKernelSession (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554995) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) at async w.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554404) at async m.startNew (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:549756) at async _.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:520500) at async /home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:32:653463] { category: 'invalidkernel', kernelConnectionMetadata: { kind: 'startUsingKernelSpec', interpreter: { architecture: 3, path: '/usr/bin/python3', version: [Object], sysVersion: '3.8.5 (default, Jul 28 2020, 12:59:40) \n[GCC 9.3.0]', sysPrefix: '/usr', fileHash: '305d49160542eaf90f0dae709d25bc0d0cf8e656008a94b2f98254f35bcb4c5d4160e1cfe46b8e76e9dc95d09946f2e706fffece8a6bd8921376447da05ea710', envType: 'Unknown', displayName: 'Python 3.8.5 64-bit' }, kernelSpec: a { specFile: '/home/ubuntu/.local/share/jupyter/kernels/python38264bit58e42c9575d24eb58f427896571571af/kernel.json', interpreterPath: '/usr/bin/python3', name: 'python38264bit58e42c9575d24eb58f427896571571af', argv: [Array], language: 'python', path: '/usr/bin/python3', display_name: 'Python 3.8.2 64-bit', metadata: [Object], env: {}, interrupt_mode: undefined } } } Error 2021-02-24 14:48:30: Exception attempting to start notebook: [i [Error]: at new t.WrappedError (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:1:153031) at /home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:32:654636 at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) Error: Kernel Python 3.8.2 64-bit is not usable. Check the Jupyter output tab for more information. at w.createNewKernelSession (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554995) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) at async w.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554404) at async m.startNew (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:549756) at async _.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:520500) at async /home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:32:653463] { category: 'invalidkernel', originalException: [c [Error]: Kernel Python 3.8.2 64-bit is not usable. Check the Jupyter output tab for more information. at w.createNewKernelSession (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554995) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) at async w.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554404) at async m.startNew (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:549756) at async _.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:520500) at async /home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:32:653463] { category: 'invalidkernel', kernelConnectionMetadata: { kind: 'startUsingKernelSpec', interpreter: [Object], kernelSpec: [a] } } } Error 2021-02-24 14:48:30: DataScience Error [i [Error]: at new t.WrappedError (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:1:153031) at /home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:32:654636 at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) Error: Kernel Python 3.8.2 64-bit is not usable. Check the Jupyter output tab for more information. at w.createNewKernelSession (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554995) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) at async w.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554404) at async m.startNew (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:549756) at async _.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:520500) at async /home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:32:653463] { category: 'invalidkernel', originalException: [c [Error]: Kernel Python 3.8.2 64-bit is not usable. Check the Jupyter output tab for more information. at w.createNewKernelSession (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554995) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) at async w.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554404) at async m.startNew (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:549756) at async _.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:520500) at async /home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:32:653463] { category: 'invalidkernel', kernelConnectionMetadata: { kind: 'startUsingKernelSpec', interpreter: [Object], kernelSpec: [a] } } } > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v ```

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. That's my one repository linked with github. I am able to run Notebook from other folder or directory but getting error when running notebook from this repository. I cloned the same repository to another directory and issue remains.

Logs

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

``` Error 2021-02-24 14:19:05: DataScience Error [i [Error]: at new t.WrappedError (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:1:153031) at /home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:32:654636 at processTicksAndRejections (internal/process/task_queues.js:97:5) Error: Kernel Python 3.8.2 64-bit is not usable. Check the Jupyter output tab for more information. at w.createNewKernelSession (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554995) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async w.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554404) at async m.startNew (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:549756) at async _.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:520500) at async /home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:32:653463] { category: 'invalidkernel', originalException: [c [Error]: Kernel Python 3.8.2 64-bit is not usable. Check the Jupyter output tab for more information. at w.createNewKernelSession (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554995) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async w.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:554404) at async m.startNew (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:549756) at async _.connect (/home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:49:520500) at async /home/ubuntu/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/out/client/extension.js:32:653463] { category: 'invalidkernel', kernelConnectionMetadata: { kind: 'startUsingKernelSpec', interpreter: [Object], kernelSpec: [a] } } } > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v > /usr/bin/python3 ~/.vscode/extensions/ms-toolsai.jupyter-2021.2.576440691/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v ```

rchiodo commented 3 years ago

Thanks for the bug.

It looks to me like the kernel can't be run by jupyter. If you attempt starting jupyter using the same kernel outside of VS code it might give you more information as to why. To do so you'd:

  1. Go to the directory with the problem in terminal
  2. Run jupyter notebook
  3. Create a new notebook
  4. Pick the python38264bit58e42c9575d24eb58f427896571571af kernel
  5. Look at the output at the terminal (assuming it will fail too)

Additionally if you could set this setting: image

That should show a lot more output in the 'jupyter' output tab in VS code.

fkhjoy commented 3 years ago

Thanks for the bug.

It looks to me like the kernel can't be run by jupyter. If you attempt starting jupyter using the same kernel outside of VS code it might give you more information as to why. To do so you'd:

1. Go to the directory with the problem in terminal

2. Run `jupyter notebook`

3. Create a new notebook

4. Pick the `python38264bit58e42c9575d24eb58f427896571571af` kernel

5. Look at the output at the terminal (assuming it will fail too)

Additionally if you could set this setting: image

That should show a lot more output in the 'jupyter' output tab in VS code.

Thank You. I also ran the notebook from terminal and web browser. It also failed to connect the kernel. I was curious to know the reason for this.

rchiodo commented 3 years ago

I was curious to know the reason for this.

It should list the reason in the terminal. You can get more info from jupyter by setting the log level higher:

jupyter notebook --log-level=DEBUG

fkhjoy commented 3 years ago

I was curious to know the reason for this.

It should list the reason in the terminal. You can get more info from jupyter by setting the log level higher:

jupyter notebook --log-level=DEBUG

I ran that way. I am not sure about those. Could you please check it ``` AttributeError: partially initialized module 'subprocess' has no attribute 'CalledProcessError' (most likely due to a circular import) [I 23:42:14.095 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports [D 23:42:14.096 NotebookApp] Starting kernel: ['/usr/bin/python3', '-m', 'ipykernel_launcher', '-f', '/home/ubuntu/.local/share/jupyter/runtime/kernel-8c7340e1-003b-4c3f-b9e0-a5754a158575.json'] [D 23:42:14.103 NotebookApp] Connecting to: tcp://127.0.0.1:40375 Traceback (most recent call last): File "/usr/lib/python3.8/platform.py", line 613, in _syscmd_uname output = subprocess.check_output(('uname', option), AttributeError: partially initialized module 'subprocess' has no attribute 'check_output' (most likely due to a circular import) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/ubuntu/.local/lib/python3.8/site-packages/ipykernel_launcher.py", line 15, in from ipykernel import kernelapp as app File "/home/ubuntu/.local/lib/python3.8/site-packages/ipykernel/__init__.py", line 2, in from .connect import * File "/home/ubuntu/.local/lib/python3.8/site-packages/ipykernel/connect.py", line 8, in from subprocess import Popen, PIPE File "/usr/lib/python3.8/subprocess.py", line 49, in import signal File "/home/ubuntu/Tasks/Python/stock_amibroker/signal.py", line 6, in import requests File "/home/ubuntu/.local/lib/python3.8/site-packages/requests/__init__.py", line 43, in import urllib3 File "/home/ubuntu/.local/lib/python3.8/site-packages/urllib3/__init__.py", line 8, in from .connectionpool import ( File "/home/ubuntu/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 35, in from .request import RequestMethods File "/home/ubuntu/.local/lib/python3.8/site-packages/urllib3/request.py", line 3, in from .filepost import encode_multipart_formdata File "/home/ubuntu/.local/lib/python3.8/site-packages/urllib3/filepost.py", line 4, in from uuid import uuid4 File "/usr/lib/python3.8/uuid.py", line 57, in _AIX = platform.system() == 'AIX' File "/usr/lib/python3.8/platform.py", line 891, in system return uname().system File "/usr/lib/python3.8/platform.py", line 857, in uname processor = _syscmd_uname('-p', '') File "/usr/lib/python3.8/platform.py", line 616, in _syscmd_uname except (OSError, subprocess.CalledProcessError): AttributeError: partially initialized module 'subprocess' has no attribute 'CalledProcessError' (most likely due to a circular import) Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3.8/platform.py", line 613, in _syscmd_uname output = subprocess.check_output(('uname', option), AttributeError: partially initialized module 'subprocess' has no attribute 'check_output' (most likely due to a circular import) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 72, in apport_excepthook from apport.fileutils import likely_packaged, get_recent_crashes File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in from apport.report import Report File "/usr/lib/python3/dist-packages/apport/report.py", line 12, in import subprocess, tempfile, os.path, re, pwd, grp, os, time, io File "/usr/lib/python3.8/subprocess.py", line 49, in import signal File "/home/ubuntu/Tasks/Python/stock_amibroker/signal.py", line 6, in import requests File "/home/ubuntu/.local/lib/python3.8/site-packages/requests/__init__.py", line 43, in import urllib3 File "/home/ubuntu/.local/lib/python3.8/site-packages/urllib3/__init__.py", line 8, in from .connectionpool import ( File "/home/ubuntu/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 35, in from .request import RequestMethods File "/home/ubuntu/.local/lib/python3.8/site-packages/urllib3/request.py", line 3, in from .filepost import encode_multipart_formdata File "/home/ubuntu/.local/lib/python3.8/site-packages/urllib3/filepost.py", line 4, in from uuid import uuid4 File "/usr/lib/python3.8/uuid.py", line 57, in _AIX = platform.system() == 'AIX' File "/usr/lib/python3.8/platform.py", line 891, in system return uname().system File "/usr/lib/python3.8/platform.py", line 857, in uname processor = _syscmd_uname('-p', '') File "/usr/lib/python3.8/platform.py", line 616, in _syscmd_uname except (OSError, subprocess.CalledProcessError): AttributeError: partially initialized module 'subprocess' has no attribute 'CalledProcessError' (most likely due to a circular import) Original exception was: Traceback (most recent call last): File "/usr/lib/python3.8/platform.py", line 613, in _syscmd_uname output = subprocess.check_output(('uname', option), AttributeError: partially initialized module 'subprocess' has no attribute 'check_output' (most likely due to a circular import) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/ubuntu/.local/lib/python3.8/site-packages/ipykernel_launcher.py", line 15, in from ipykernel import kernelapp as app File "/home/ubuntu/.local/lib/python3.8/site-packages/ipykernel/__init__.py", line 2, in from .connect import * File "/home/ubuntu/.local/lib/python3.8/site-packages/ipykernel/connect.py", line 8, in from subprocess import Popen, PIPE File "/usr/lib/python3.8/subprocess.py", line 49, in import signal File "/home/ubuntu/Tasks/Python/stock_amibroker/signal.py", line 6, in import requests File "/home/ubuntu/.local/lib/python3.8/site-packages/requests/__init__.py", line 43, in import urllib3 File "/home/ubuntu/.local/lib/python3.8/site-packages/urllib3/__init__.py", line 8, in from .connectionpool import ( File "/home/ubuntu/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 35, in from .request import RequestMethods File "/home/ubuntu/.local/lib/python3.8/site-packages/urllib3/request.py", line 3, in from .filepost import encode_multipart_formdata File "/home/ubuntu/.local/lib/python3.8/site-packages/urllib3/filepost.py", line 4, in from uuid import uuid4 File "/usr/lib/python3.8/uuid.py", line 57, in _AIX = platform.system() == 'AIX' File "/usr/lib/python3.8/platform.py", line 891, in system return uname().system File "/usr/lib/python3.8/platform.py", line 857, in uname processor = _syscmd_uname('-p', '') File "/usr/lib/python3.8/platform.py", line 616, in _syscmd_uname except (OSError, subprocess.CalledProcessError): AttributeError: partially initialized module 'subprocess' has no attribute 'CalledProcessError' (most likely due to a circular import) [W 23:42:17.107 NotebookApp] KernelRestarter: restart failed [W 23:42:17.107 NotebookApp] Kernel 8c7340e1-003b-4c3f-b9e0-a5754a158575 died, removing from map. [D 23:42:23.161 NotebookApp] Initializing websocket connection /api/kernels/8c7340e1-003b-4c3f-b9e0-a5754a158575/channels [W 23:42:23.164 NotebookApp] Replacing stale connection: 8c7340e1-003b-4c3f-b9e0-a5754a158575:758db712c18141d9834514e6851c6050 [D 23:42:45.197 NotebookApp] Initializing websocket connection /api/kernels/8c7340e1-003b-4c3f-b9e0-a5754a158575/channels [W 23:42:45.199 NotebookApp] Replacing stale connection: 8c7340e1-003b-4c3f-b9e0-a5754a158575:758db712c18141d9834514e6851c6050 [W 23:43:02.161 NotebookApp] Timeout waiting for kernel_info reply from 8c7340e1-003b-4c3f-b9e0-a5754a158575 [D 23:43:02.163 NotebookApp] 101 GET /api/kernels/8c7340e1-003b-4c3f-b9e0-a5754a158575/channels?session_id=758db712c18141d9834514e6851c6050 (127.0.0.1) 60022.010000ms [D 23:43:02.163 NotebookApp] Opening websocket /api/kernels/8c7340e1-003b-4c3f-b9e0-a5754a158575/channels [D 23:43:02.164 NotebookApp] Getting buffer for 8c7340e1-003b-4c3f-b9e0-a5754a158575 [E 23:43:02.164 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: 8c7340e1-003b-4c3f-b9e0-a5754a158575) [D 23:43:02.165 NotebookApp] Websocket closed 8c7340e1-003b-4c3f-b9e0-a5754a158575:758db712c18141d9834514e6851c6050 [W 23:43:02.166 NotebookApp] 404 GET /api/kernels/8c7340e1-003b-4c3f-b9e0-a5754a158575/channels?session_id=758db712c18141d9834514e6851c6050 (127.0.0.1): Kernel does not exist: 8c7340e1-003b-4c3f-b9e0-a5754a158575 [D 23:43:02.166 NotebookApp] Using contents: services/contents [W 23:43:02.168 NotebookApp] 404 GET /api/kernels/8c7340e1-003b-4c3f-b9e0-a5754a158575/channels?session_id=758db712c18141d9834514e6851c6050 (127.0.0.1) 39007.610000ms referer=None [W 23:43:02.169 NotebookApp] 404 GET /api/kernels/8c7340e1-003b-4c3f-b9e0-a5754a158575/channels?session_id=758db712c18141d9834514e6851c6050 (127.0.0.1): Kernel does not exist: 8c7340e1-003b-4c3f-b9e0-a5754a158575 [D 23:43:02.169 NotebookApp] Using contents: services/contents [W 23:43:02.170 NotebookApp] 404 GET /api/kernels/8c7340e1-003b-4c3f-b9e0-a5754a158575/channels?session_id=758db712c18141d9834514e6851c6050 (127.0.0.1) 16973.120000ms referer=None [D 23:43:06.182 NotebookApp] Initializing websocket connection /api/kernels/8c7340e1-003b-4c3f-b9e0-a5754a158575/channels [W 23:43:06.185 NotebookApp] Replacing stale connection: 8c7340e1-003b-4c3f-b9e0-a5754a158575:758db712c18141d9834514e6851c6050 ```
rchiodo commented 3 years ago

That sounds like the kernelspec might be invalid. At least stack overflow is pointing to unicode problems that might cause that subprocess error.

Can you try deleting this kernel directory (it was created by VS code) /home/ubuntu/.local/share/jupyter/kernels/python38264bit58e42c9575d24eb58f427896571571af

And then trying again?

fkhjoy commented 3 years ago

Can you try deleting this kernel directory (it was created by VS code) /home/ubuntu/.local/share/jupyter/kernels/python38264bit58e42c9575d24eb58f427896571571af

And then trying again?

I deleted that Kernel. I had to set a new kernel after opening jupyter notebook. I am sharing both my terminal and browser issue.

Screenshot from 2021-02-25 00-23-34

rchiodo commented 3 years ago

Did you start and stop jupyter after deleting that kernel?

That looks like it's trying to attach to the existing kernel.

fkhjoy commented 3 years ago

Did you start and stop jupyter after deleting that kernel?

That looks like it's trying to attach to the existing kernel.

Yes. I restarted the kernel. It showed like "Start without kernel" or "Set up a new kernel" Then I set up a new kernel.

rchiodo commented 3 years ago

Sorry I meant kill jupyter itself. Not just the old kernel. Restart jupyter notebook

fkhjoy commented 3 years ago

Sorry I meant kill jupyter itself. Not just the old kernel. Restart jupyter notebook

Sorry. I meant that. After deleting, I restarted the Jupyter from Terminal

rchiodo commented 3 years ago

And what does the terminal output show? Does it give you a 404 error?

This issue here may be relevant. https://github.com/jupyter/notebook/issues/5814

Hopefully if you're getting an error from jupyter it's giving you something more than just a 404.

fkhjoy commented 3 years ago

Hopefully if you're getting an error from jupyter it's giving you something more than just a 404.

I am facing this issue from yesterday. Even if I clone the same repository from my github, it throws same problem. So, what could be the notebook's internal issue? Also, I noticed that, I am facing the same problem for each notebook in that directory even after creating new notebook. My settings.json is

{
    "files.associations": {
        "deque": "cpp",
        "string": "cpp",
        "vector": "cpp"
    },
    "python.pythonPath": "/usr/bin/python3"
}

And another notebook is running well, that has only on different directory


{
    "python.pythonPath": "/usr/bin/python3"
}
fkhjoy commented 3 years ago

So, I found a solution. If I run from different window of vscode and not being in the directory of the notebook, it runs smoothly.

So, Kernel is failing when I run being at the same directory in a window. And the problem is in the directory for all .ipynb and also .py file I recently noticed.

DonJayamanne commented 3 years ago

@fkhjoy

Thanks

DonJayamanne commented 3 years ago

Closing this issue as its been over 4 weeks, since the information was requested. We'll be happy to reopen the issue when the requested information has been provided.