Open pine1needle opened 1 year ago
I spent a long time trying to troubleshoot this issue. I still don't understand the error or how to fix it, but I found some code that I believe might be relevant.
Is there a problem with the extension.js file?
Hi @pine1needle
The magic command livebash
should be loaded after running the !jupyter nbextension enable --py --system ipylivebash
command. Then, %%livebash
can be executed in a cell. Unfortunately, no output is returned, although the script is executed.
%%livebash
touch 123
No output
%%bash
ls
Output:
123
sample_data
I have tested ipylivebash with Jupyter Notebook and Jupyter Labs only. And seem that it need to handle Google Colab in a special way.
I am sorry that I could not fix it in a short time.
Thank you for the reply. It is helpful to know that %%livebash
runs the script even though it does not display the output.
Also, running the !jupyter nbextension enable --py --system ipylivebash
command in Google Colab might not be necessary. The %%livebash
command seems to behave the same way no matter whether the !jupyter nbextension enable --py --system ipylivebash
command has been run or not.
After installing the extension in Google Colab, I attempt to load it using the _%loadext magic command, but the cell output says "The ipylivebash module is not an IPython extension." The code that I ran to install the extension and attempt to load it are listed below. Clicking "Cell Output" should reveal the output of the code immediately above it.
Code of Each Cell and its Corresponding Output
!pip install ipylivebash
Cell Output
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/ Collecting ipylivebash Downloading ipylivebash-0.1.2-py2.py3-none-any.whl (99 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99.4/99.4 KB 2.3 MB/s eta 0:00:00 Requirement already satisfied: ipywidgets>=7.0.0 in /usr/local/lib/python3.9/dist-packages (from ipylivebash) (7.7.1) Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /usr/local/lib/python3.9/dist-packages (from ipywidgets>=7.0.0->ipylivebash) (3.0.5) Requirement already satisfied: traitlets>=4.3.1 in /usr/local/lib/python3.9/dist-packages (from ipywidgets>=7.0.0->ipylivebash) (5.7.1) Requirement already satisfied: ipykernel>=4.5.1 in /usr/local/lib/python3.9/dist-packages (from ipywidgets>=7.0.0->ipylivebash) (5.3.4) Requirement already satisfied: ipython>=4.0.0 in /usr/local/lib/python3.9/dist-packages (from ipywidgets>=7.0.0->ipylivebash) (7.9.0) Requirement already satisfied: ipython-genutils~=0.2.0 in /usr/local/lib/python3.9/dist-packages (from ipywidgets>=7.0.0->ipylivebash) (0.2.0) Requirement already satisfied: widgetsnbextension~=3.6.0 in /usr/local/lib/python3.9/dist-packages (from ipywidgets>=7.0.0->ipylivebash) (3.6.2) Requirement already satisfied: tornado>=4.2 in /usr/local/lib/python3.9/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.0.0->ipylivebash) (6.2) Requirement already satisfied: jupyter-client in /usr/local/lib/python3.9/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.0.0->ipylivebash) (6.1.12) Collecting jedi>=0.10 Downloading jedi-0.18.2-py2.py3-none-any.whl (1.6 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 21.3 MB/s eta 0:00:00 Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python3.9/dist-packages (from ipython>=4.0.0->ipywidgets>=7.0.0->ipylivebash) (63.4.3) Requirement already satisfied: decorator in /usr/local/lib/python3.9/dist-packages (from ipython>=4.0.0->ipywidgets>=7.0.0->ipylivebash) (4.4.2) Requirement already satisfied: backcall in /usr/local/lib/python3.9/dist-packages (from ipython>=4.0.0->ipywidgets>=7.0.0->ipylivebash) (0.2.0) Requirement already satisfied: pickleshare in /usr/local/lib/python3.9/dist-packages (from ipython>=4.0.0->ipywidgets>=7.0.0->ipylivebash) (0.7.5) Requirement already satisfied: prompt-toolkit<2.1.0,>=2.0.0 in /usr/local/lib/python3.9/dist-packages (from ipython>=4.0.0->ipywidgets>=7.0.0->ipylivebash) (2.0.10) Requirement already satisfied: pygments in /usr/local/lib/python3.9/dist-packages (from ipython>=4.0.0->ipywidgets>=7.0.0->ipylivebash) (2.6.1) Requirement already satisfied: pexpect in /usr/local/lib/python3.9/dist-packages (from ipython>=4.0.0->ipywidgets>=7.0.0->ipylivebash) (4.8.0) Requirement already satisfied: notebook>=4.4.1 in /usr/local/lib/python3.9/dist-packages (from widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (6.3.0) Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/lib/python3.9/dist-packages (from jedi>=0.10->ipython>=4.0.0->ipywidgets>=7.0.0->ipylivebash) (0.8.3) Requirement already satisfied: pyzmq>=17 in /usr/local/lib/python3.9/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (23.2.1) Requirement already satisfied: nbconvert in /usr/local/lib/python3.9/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (6.5.4) Requirement already satisfied: nbformat in /usr/local/lib/python3.9/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (5.7.3) Requirement already satisfied: argon2-cffi in /usr/local/lib/python3.9/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (21.3.0) Requirement already satisfied: prometheus-client in /usr/local/lib/python3.9/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (0.16.0) Requirement already satisfied: terminado>=0.8.3 in /usr/local/lib/python3.9/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (0.17.1) Requirement already satisfied: jinja2 in /usr/local/lib/python3.9/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (3.1.2) Requirement already satisfied: Send2Trash>=1.5.0 in /usr/local/lib/python3.9/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (1.8.0) Requirement already satisfied: jupyter-core>=4.6.1 in /usr/local/lib/python3.9/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (5.2.0) Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.9/dist-packages (from jupyter-client->ipykernel>=4.5.1->ipywidgets>=7.0.0->ipylivebash) (2.8.2) Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.9/dist-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython>=4.0.0->ipywidgets>=7.0.0->ipylivebash) (1.15.0) Requirement already satisfied: wcwidth in /usr/local/lib/python3.9/dist-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython>=4.0.0->ipywidgets>=7.0.0->ipylivebash) (0.2.6) Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.9/dist-packages (from pexpect->ipython>=4.0.0->ipywidgets>=7.0.0->ipylivebash) (0.7.0) Requirement already satisfied: platformdirs>=2.5 in /usr/local/lib/python3.9/dist-packages (from jupyter-core>=4.6.1->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (3.1.1) Requirement already satisfied: argon2-cffi-bindings in /usr/local/lib/python3.9/dist-packages (from argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (21.2.0) Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.9/dist-packages (from jinja2->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (2.1.2) Requirement already satisfied: jupyterlab-pygments in /usr/local/lib/python3.9/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (0.2.2) Requirement already satisfied: defusedxml in /usr/local/lib/python3.9/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (0.7.1) Requirement already satisfied: lxml in /usr/local/lib/python3.9/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (4.9.2) Requirement already satisfied: packaging in /usr/local/lib/python3.9/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (23.0) Requirement already satisfied: tinycss2 in /usr/local/lib/python3.9/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (1.2.1) Requirement already satisfied: nbclient>=0.5.0 in /usr/local/lib/python3.9/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (0.7.2) Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.9/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (1.5.0) Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/lib/python3.9/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (0.8.4) Requirement already satisfied: bleach in /usr/local/lib/python3.9/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (6.0.0) Requirement already satisfied: entrypoints>=0.2.2 in /usr/local/lib/python3.9/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (0.4) Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.9/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (4.11.2) Requirement already satisfied: fastjsonschema in /usr/local/lib/python3.9/dist-packages (from nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (2.16.3) Requirement already satisfied: jsonschema>=2.6 in /usr/local/lib/python3.9/dist-packages (from nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (4.3.3) Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /usr/local/lib/python3.9/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (0.19.3) Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.9/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (22.2.0) Requirement already satisfied: cffi>=1.0.1 in /usr/local/lib/python3.9/dist-packages (from argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (1.15.1) Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.9/dist-packages (from beautifulsoup4->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (2.4) Requirement already satisfied: webencodings in /usr/local/lib/python3.9/dist-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (0.5.1) Requirement already satisfied: pycparser in /usr/local/lib/python3.9/dist-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->ipylivebash) (2.21) Installing collected packages: jedi, ipylivebash Successfully installed ipylivebash-0.1.2 jedi-0.18.2%load_ext ipylivebash
Cell Output
The ipylivebash module is not an IPython extension.!jupyter nbextension enable --py --system ipylivebash
Cell Output
Enabling notebook extension ipylivebash/extension... Paths used for configuration of notebook: /usr/local/etc/jupyter/nbconfig/notebook.d/ipylivebash.json /usr/local/etc/jupyter/nbconfig/notebook.d/jupyterlab-plotly.json /usr/local/etc/jupyter/nbconfig/notebook.d/widgetsnbextension.json /usr/local/etc/jupyter/nbconfig/notebook.json Paths used for configuration of notebook: /usr/local/etc/jupyter/nbconfig/notebook.d/ipylivebash.json /usr/local/etc/jupyter/nbconfig/notebook.d/jupyterlab-plotly.json /usr/local/etc/jupyter/nbconfig/notebook.d/widgetsnbextension.json - Validating: OK Paths used for configuration of notebook: /usr/local/etc/jupyter/nbconfig/notebook.d/ipylivebash.json /usr/local/etc/jupyter/nbconfig/notebook.d/jupyterlab-plotly.json /usr/local/etc/jupyter/nbconfig/notebook.d/widgetsnbextension.json /usr/local/etc/jupyter/nbconfig/notebook.json%load_ext ipylivebash
Cell Output
The ipylivebash module is not an IPython extension.