microsoft / vscode-jupyter

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

Can't run cells on Codespaces #7869

Closed roblourens closed 2 years ago

roblourens commented 3 years ago

Environment data


Logs

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

``` Info 2021-10-08 18:52:33: Execute Cells request 1 1 Info 2021-10-08 18:52:33: Execute Cell 1 file:///workspaces/data-science/Titanic.ipynb Info 2021-10-08 18:52:33: Starting Notebook in kernel.ts id = .jvsc74a57bd0a348d05e34e8044ae1e9d07d1d1b44415d69cd1da266fd7d8ffa1d17ad3cd578./workspaces/data-science/.venv/python./workspaces/data-science/.venv/python.-m#ipykernel_launcher Info 2021-10-08 18:52:33: Creating raw notebook for file:///workspaces/data-science/Titanic.ipynb Info 2021-10-08 18:52:33: Getting preferred kernel for file:///workspaces/data-science/Titanic.ipynb Info 2021-10-08 18:52:33: Computing working directory file:///workspaces/data-science/Titanic.ipynb Info 2021-10-08 18:52:33: Connecting to raw session for file:///workspaces/data-science/Titanic.ipynb with connection {"kind":"startUsingPythonInterpreter","kernelSpec":{"specFile":"/home/codespace/.local/share/jupyter/kernels/python386jvsc74a57bd0a348d05e34e8044ae1e9d07d1d1b44415d69cd1da266fd7d8ffa1d17ad3cd578/kernel.json","interpreterPath":"/workspaces/data-science/.venv/bin/python","name":"python386jvsc74a57bd0a348d05e34e8044ae1e9d07d1d1b44415d69cd1da266fd7d8ffa1d17ad3cd578","argv":["python","-m","ipykernel_launcher","-f","{connection_file}"],"language":"python","path":"python","display_name":"Python 3.8.6 64-bit ('.venv': venv)","metadata":{"interpreter":{"sysPrefix":"/workspaces/data-science/.venv","envType":"Venv","envName":".venv","envPath":"/workspaces/data-science/.venv","path":"/workspaces/data-science/.venv/bin/python","architecture":3,"sysVersion":"3.8.6 (default, Nov 18 2020, 04:48:50) \n[GCC 9.3.0]","version":{"raw":"3.8.6","major":3,"minor":8,"patch":6,"build":[],"prerelease":["final","0"]},"displayName":"Python 3.8.6 64-bit ('.venv': venv)"}},"env":{}},"interpreter":{"sysPrefix":"/workspaces/data-science/.venv","envType":"Venv","envName":".venv","envPath":"/workspaces/data-science/.venv","path":"/workspaces/data-science/.venv/bin/python","architecture":3,"sysVersion":"3.8.6 (default, Nov 18 2020, 04:48:50) \n[GCC 9.3.0]","version":{"raw":"3.8.6","major":3,"minor":8,"patch":6,"build":[],"prerelease":["final","0"]},"displayName":"Python 3.8.6 64-bit ('.venv': venv)"},"id":".jvsc74a57bd0a348d05e34e8044ae1e9d07d1d1b44415d69cd1da266fd7d8ffa1d17ad3cd578./workspaces/data-science/.venv/python./workspaces/data-science/.venv/python.-m#ipykernel_launcher"} Info 2021-10-08 18:52:33: Starting raw kernel Python 3.8.6 64-bit ('.venv': venv) Info 2021-10-08 18:52:33: installMissingDependencies /workspaces/data-science/.venv/bin/python Info 2021-10-08 18:52:33: Process Execution: > /workspaces/data-science/.venv/bin/python -c "import ipykernel" > /workspaces/data-science/.venv/bin/python -c "import ipykernel" Info 2021-10-08 18:52:33: Process Execution: > /workspaces/data-science/.venv/bin/python -m pip list > /workspaces/data-science/.venv/bin/python -m pip list Error 2021-10-08 18:52:44: Install Missing Dependencies, Class name = E, completed in 11165ms, has a falsy return value, Return Value: undefined a [Error]: IPyKernel not installed into interpreter Python 3.8.6 64-bit ('.venv': venv):/workspaces/data-science/.venv/bin/python at E.handleKernelDependencyResponse (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:293361) at E.installMissingDependencies (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:292690) { category: 'noipykernel', reason: 2 } Error 2021-10-08 18:52:44: Raw session failed to start because dependencies not installed Info 2021-10-08 18:52:44: Shutdown session -- complete Error 2021-10-08 18:52:44: failed to create INotebook in kernel, UI Disabled = undefined a [Error]: IPyKernel not installed into interpreter Python 3.8.6 64-bit ('.venv': venv):/workspaces/data-science/.venv/bin/python at E.handleKernelDependencyResponse (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:293361) at E.installMissingDependencies (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:292690) { category: 'noipykernel', reason: 2 } Error 2021-10-08 18:52:44: DataScience Error a [Error]: IPyKernel not installed into interpreter Python 3.8.6 64-bit ('.venv': venv):/workspaces/data-science/.venv/bin/python at E.handleKernelDependencyResponse (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:293361) at E.installMissingDependencies (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:292690) { category: 'noipykernel', reason: 2 } Error 2021-10-08 18:52:44: failed to start INotebook in kernel, UI Disabled = undefined a [Error]: IPyKernel not installed into interpreter Python 3.8.6 64-bit ('.venv': venv):/workspaces/data-science/.venv/bin/python at E.handleKernelDependencyResponse (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:293361) at E.installMissingDependencies (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:292690) { category: 'noipykernel', reason: 2 } Error 2021-10-08 18:52:44: Failed to execute cells in CellExecutionQueue a [Error]: IPyKernel not installed into interpreter Python 3.8.6 64-bit ('.venv': venv):/workspaces/data-science/.venv/bin/python at E.handleKernelDependencyResponse (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:293361) at E.installMissingDependencies (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:292690) { category: 'noipykernel', reason: 2 } Info 2021-10-08 18:52:44: Cancel pending cells Info 2021-10-08 18:52:45: Execute Cells request 1 1 Info 2021-10-08 18:52:45: Execute Cell 1 file:///workspaces/data-science/Titanic.ipynb Info 2021-10-08 18:52:45: Starting Notebook in kernel.ts id = .jvsc74a57bd0a348d05e34e8044ae1e9d07d1d1b44415d69cd1da266fd7d8ffa1d17ad3cd578./workspaces/data-science/.venv/python./workspaces/data-science/.venv/python.-m#ipykernel_launcher Info 2021-10-08 18:52:45: Creating raw notebook for file:///workspaces/data-science/Titanic.ipynb Info 2021-10-08 18:52:45: Getting preferred kernel for file:///workspaces/data-science/Titanic.ipynb Info 2021-10-08 18:52:45: Computing working directory file:///workspaces/data-science/Titanic.ipynb Info 2021-10-08 18:52:45: Connecting to raw session for file:///workspaces/data-science/Titanic.ipynb with connection {"kind":"startUsingPythonInterpreter","kernelSpec":{"specFile":"/home/codespace/.local/share/jupyter/kernels/python386jvsc74a57bd0a348d05e34e8044ae1e9d07d1d1b44415d69cd1da266fd7d8ffa1d17ad3cd578/kernel.json","interpreterPath":"/workspaces/data-science/.venv/bin/python","name":"python386jvsc74a57bd0a348d05e34e8044ae1e9d07d1d1b44415d69cd1da266fd7d8ffa1d17ad3cd578","argv":["python","-m","ipykernel_launcher","-f","{connection_file}"],"language":"python","path":"python","display_name":"Python 3.8.6 64-bit ('.venv': venv)","metadata":{"interpreter":{"sysPrefix":"/workspaces/data-science/.venv","envType":"Venv","envName":".venv","envPath":"/workspaces/data-science/.venv","path":"/workspaces/data-science/.venv/bin/python","architecture":3,"sysVersion":"3.8.6 (default, Nov 18 2020, 04:48:50) \n[GCC 9.3.0]","version":{"raw":"3.8.6","major":3,"minor":8,"patch":6,"build":[],"prerelease":["final","0"]},"displayName":"Python 3.8.6 64-bit ('.venv': venv)"}},"env":{}},"interpreter":{"sysPrefix":"/workspaces/data-science/.venv","envType":"Venv","envName":".venv","envPath":"/workspaces/data-science/.venv","path":"/workspaces/data-science/.venv/bin/python","architecture":3,"sysVersion":"3.8.6 (default, Nov 18 2020, 04:48:50) \n[GCC 9.3.0]","version":{"raw":"3.8.6","major":3,"minor":8,"patch":6,"build":[],"prerelease":["final","0"]},"displayName":"Python 3.8.6 64-bit ('.venv': venv)"},"id":".jvsc74a57bd0a348d05e34e8044ae1e9d07d1d1b44415d69cd1da266fd7d8ffa1d17ad3cd578./workspaces/data-science/.venv/python./workspaces/data-science/.venv/python.-m#ipykernel_launcher"} Info 2021-10-08 18:52:45: Starting raw kernel Python 3.8.6 64-bit ('.venv': venv) Info 2021-10-08 18:52:45: installMissingDependencies /workspaces/data-science/.venv/bin/python Info 2021-10-08 18:52:45: Process Execution: > /workspaces/data-science/.venv/bin/python -c "import ipykernel" > /workspaces/data-science/.venv/bin/python -c "import ipykernel" Info 2021-10-08 18:52:47: Process Execution: > /workspaces/data-science/.venv/bin/python -m pip list > /workspaces/data-science/.venv/bin/python -m pip list Error 2021-10-08 18:52:59: Install Missing Dependencies, Class name = E, completed in 13756ms, has a falsy return value, Return Value: undefined a [Error]: IPyKernel not installed into interpreter Python 3.8.6 64-bit ('.venv': venv):/workspaces/data-science/.venv/bin/python at E.handleKernelDependencyResponse (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:293361) at E.installMissingDependencies (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:292690) { category: 'noipykernel', reason: 2 } Error 2021-10-08 18:52:59: Raw session failed to start because dependencies not installed Info 2021-10-08 18:52:59: Shutdown session -- complete Error 2021-10-08 18:52:59: failed to create INotebook in kernel, UI Disabled = undefined a [Error]: IPyKernel not installed into interpreter Python 3.8.6 64-bit ('.venv': venv):/workspaces/data-science/.venv/bin/python at E.handleKernelDependencyResponse (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:293361) at E.installMissingDependencies (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:292690) { category: 'noipykernel', reason: 2 } Error 2021-10-08 18:52:59: DataScience Error a [Error]: IPyKernel not installed into interpreter Python 3.8.6 64-bit ('.venv': venv):/workspaces/data-science/.venv/bin/python at E.handleKernelDependencyResponse (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:293361) at E.installMissingDependencies (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:292690) { category: 'noipykernel', reason: 2 } Error 2021-10-08 18:52:59: failed to start INotebook in kernel, UI Disabled = undefined a [Error]: IPyKernel not installed into interpreter Python 3.8.6 64-bit ('.venv': venv):/workspaces/data-science/.venv/bin/python at E.handleKernelDependencyResponse (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:293361) at E.installMissingDependencies (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:292690) { category: 'noipykernel', reason: 2 } Error 2021-10-08 18:52:59: Failed to execute cells in CellExecutionQueue a [Error]: IPyKernel not installed into interpreter Python 3.8.6 64-bit ('.venv': venv):/workspaces/data-science/.venv/bin/python at E.handleKernelDependencyResponse (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:293361) at E.installMissingDependencies (/home/codespace/.vscode-remote/extensions/ms-toolsai.jupyter-2021.9.1001312534/out/client/extension.js:54:292690) { category: 'noipykernel', reason: 2 } Info 2021-10-08 18:52:59: Cancel pending cells ```

Seems like the log said it failed to install ipykernel, but the terminal says it worked

[...]
Successfully installed backcall-0.2.0 debugpy-1.5.0 decorator-5.1.0 entrypoints-0.3 ipykernel-6.4.1 ipython-7.28.0 ipython-genutils-0.2.0 jedi-0.18.0 jupyter-client-7.0.6 jupyter-core-4.8.1 matplotlib-inline-0.1.3 nest-asyncio-1.5.1 parso-0.8.2 pexpect-4.8.0 pickleshare-0.7.5 prompt-toolkit-3.0.20 ptyprocess-0.7.0 pygments-2.10.0 python-dateutil-2.8.2 pyzmq-22.3.0 setuptools-58.2.0 six-1.16.0 tornado-6.1 traitlets-5.1.0 wcwidth-0.2.5
WARNING: You are using pip version 21.1.1; however, version 21.2.4 is available.
You should consider upgrading via the '/workspaces/data-science/.venv/bin/python -m pip install --upgrade pip' command.
DonJayamanne commented 3 years ago

I'll take a look

DonJayamanne commented 3 years ago

Yup, looks like ipykernel isn't installed properly even though the installation script runs to completion. fun with python package management

Error: mportError: libffi.so.6: cannot open shared object file: No such file or directory

I think we should modify the code to display this error message (we ran into similar issues when ipykernel didn't install ipyton_genutils recently, installation was successful, but could not be imported just like this scenario)

DonJayamanne commented 3 years ago

I think creating a github code space like this will not work, ther'es no base image here. I would suggest creating a docker file or the like (create a github codespace based on some popular containers for jupyter)

Basically we have issues with missing dependencies, that that's what docker container files address, getting everything setup and ready to go.

@claudiaregio curious, why did you you use a container image? (e.g. the ones availabel for jupyter or datascience)

DonJayamanne commented 3 years ago

@claudiaregio @roblourens Do you know how the .venv is automatically created? Also there are a lot of Python environments, which seems very weird image

roblourens commented 3 years ago

It would be created by this tool: https://github.com/microsoft/Oryx

IanMatthewHuff commented 2 years ago

Tagging @DonJayamanne since that's when the info needed flag was added. This issue still need attention?

DonJayamanne commented 2 years ago

ded. This issue still need attention?

Yes, basically we'd need to chase this up with the authors of Oryx and figure out why pip installation fails. Error: mportError: libffi.so.6: cannot open shared object file: No such file or directory

DonJayamanne commented 2 years ago

I believe this will be addressed once we select the right kernel in the kernel picker. Also, to my knowledge All containers in Codespaces now have Jupyter installed, hence this shouldn't be an issue anymore. I think we could just close this and get this verifeid.

Hence closing this issue so this gets verifeid in the August milestone

roblourens commented 2 years ago

Works now 👍