Ask Your Question

Revision history [back]

The relevent part of the log you posted seems to be:

File "/home/jcb/.local/lib/python2.7/site-packages/hide_code/hide_code.py", line 9, in <module>
    from hide_code.hide_code_html_exporter import HideCodeHTMLExporter
ImportError: No module named hide_code_html_exporter

which means hide_code module seems to exist, but not the submodule hide_code_html_exporter. It seems to be a problem of versions. Maybe that submodule does not exist in the version you installed? Seems strange.

As John suggests, I would suggest to install the latest version of SageMath >=9 (notice that this now uses Python 3 syntax). After enabling ssl support to get pip to work (see other ask questions), then, you can install jupyterlab with:

cd SAGE_ROOT
./sage -pip install jupyterlab

Then, jupyter extensions can be installed usually with:

./sage -pip install hide-code

The relevent part of the log you posted seems to be:

File "/home/jcb/.local/lib/python2.7/site-packages/hide_code/hide_code.py", line 9, in <module>
    from hide_code.hide_code_html_exporter import HideCodeHTMLExporter
ImportError: No module named hide_code_html_exporter

which means hide_code module seems to exist, but not the submodule hide_code_html_exporter. It seems to be a problem of versions. Maybe that submodule does not exist in the version you installed? Seems strange.

As John suggests, I would suggest to install the latest version of SageMath >=9 (notice that this now uses Python 3 syntax). After enabling ssl support to get pip to work (see other ask questions), then, you can install jupyterlab with:

cd SAGE_ROOT
./sage -pip install jupyterlab

This allows to run jupyter or jupyterlab from any directory:

./sage -n jupyter --notebook-dir=<PATH-TO-CHOSEN-DIRECTORY>
./sage -n jupyterlab --notebook-dir=<PATH-TO-CHOSEN-DIRECTORY>

Then, jupyter extensions can be installed usually with:

./sage -pip install hide-code

The relevent part of the log you posted seems to be:

File "/home/jcb/.local/lib/python2.7/site-packages/hide_code/hide_code.py", line 9, in <module>
    from hide_code.hide_code_html_exporter import HideCodeHTMLExporter
ImportError: No module named hide_code_html_exporter

which means hide_code module seems to exist, but not the submodule hide_code_html_exporter. It seems to be a problem of versions. Maybe that submodule does not exist in the version you installed? Seems strange.

As John suggests, I would suggest to install the latest version of SageMath >=9 (notice that this now uses Python 3 syntax). syntax). After enabling ssl support to get pip to work (see other ask questions), then, you can install jupyterlab pip packages.

EDIT: I just manage to install hide_code on my Ubuntu machine running SageMath >=9.0. Below is what I did. The hide_code jupyter extension can be installed with:

cd SAGE_ROOT
./sage -pip install jupyterlab
hide_code

This allows to run jupyter or jupyterlab from any directory:

./sage -n jupyter --notebook-dir=<PATH-TO-CHOSEN-DIRECTORY>
./sage -n jupyterlab --notebook-dir=<PATH-TO-CHOSEN-DIRECTORY>

Then, jupyter extensions can be installed usually with:also installs the latest version of prompt-toolkit-3.0.4 which is a dependency of hide_code. But it turns out that the current hide_code (=hide-code-0.5.5) depends on a older version of prompt_toolkit<2.0.0,>=1.0.4. Therefore, I needed to install the following version of prompt_toolkit which uninstall the other one:

./sage -pip install hide-code
prompt_toolkit==1.0.4

Then, I can complete the installation of hide_code with the following command run in the sage shell environnent that I obtained from here:

sage -sh
jupyter-nbextension install --py hide_code --sys-prefix
jupyter-nbextension enable --py hide_code --sys-prefix
jupyter-serverextension enable --py hide_code --sys-prefix

Moreover, to install jupyterlab, one may do:

./sage -pip install jupyterlab

The relevent part of the log you posted seems to be:

File "/home/jcb/.local/lib/python2.7/site-packages/hide_code/hide_code.py", line 9, in <module>
    from hide_code.hide_code_html_exporter import HideCodeHTMLExporter
error message ImportError: No module named hide_code_html_exporter

which hide_code_html_exporter means hide_code module seems to exist, but not the submodule hide_code_html_exporter. It seems to be a problem of versions. Maybe that submodule does not exist in the version you installed? Seems strange.

As John suggests, I would suggest to install the latest version of SageMath >=9 (notice that this now uses Python 3 syntax). After enabling ssl support to get pip to work (see other ask questions), then, you can install pip packages.

EDIT: I just manage to install hide_code on my Ubuntu machine running SageMath >=9.0. Below is what I did. The hide_code jupyter extension can be installed with:

cd SAGE_ROOT
./sage -pip install hide_code

This also installs the latest version of prompt-toolkit-3.0.4 which is a dependency of hide_code. But it turns out that the current hide_code (=hide-code-0.5.5) depends on a older version of prompt_toolkit<2.0.0,>=1.0.4. Therefore, I needed to install the following version of prompt_toolkit which uninstall the other one:

./sage -pip install prompt_toolkit==1.0.4

Then, I can complete the installation of hide_code with the following command run in the sage shell environnent that I obtained from here:

sage -sh
jupyter-nbextension install --py hide_code --sys-prefix
jupyter-nbextension enable --py hide_code --sys-prefix
jupyter-serverextension enable --py hide_code --sys-prefix

Moreover, to install jupyterlab, one may do:

./sage -pip install jupyterlab

The error message ImportError: No module named hide_code_html_exporter means hide_code module seems to exist, but not the submodule hide_code_html_exporter. It seems to be a problem of versions. Maybe that submodule does not exist in the version you installed? Seems strange.

As John suggests, I would suggest to install the latest version of SageMath >=9 (notice that this now uses Python 3 syntax). After enabling ssl support to get pip to work (see other ask questions), then, you can install pip packages.

EDIT: I just manage to install hide_code on my Ubuntu machine running SageMath >=9.0. Below is what I did. The hide_code jupyter extension can be installed with:

cd SAGE_ROOT
./sage -pip install hide_code

This also installs the latest version of prompt-toolkit-3.0.4 which is a dependency of hide_code. But it turns out that the current hide_code (=hide-code-0.5.5) depends on a older version of prompt_toolkit<2.0.0,>=1.0.4. Therefore, I needed to install the following version of prompt_toolkit which uninstall the other one:

./sage -pip install prompt_toolkit==1.0.4

Then, I can complete the installation of hide_code with the following command run in the sage shell environnent that I obtained from here:

sage -sh
jupyter-nbextension install --py hide_code --sys-prefix
jupyter-nbextension enable --py hide_code --sys-prefix
jupyter-serverextension enable --py hide_code --sys-prefix

To learn how to use hide_code is explained in a video in this page : https://github.com/kirbs-/hide_code

Moreover, to install jupyterlab, one may do:

./sage -pip install jupyterlab