jupyter-widgets-contrib / ipysheet

Jupyter handsontable integration
MIT License
543 stars 68 forks source link

fail to build on jupyterlab 3.1.7 for @5.0.0 #209

Closed TermeHansen closed 3 years ago

TermeHansen commented 3 years ago
jupyter-labextension install ipysheet@0.5
[LabBuildApp] JupyterLab 3.1.7

failing, showing this in log

[LabBuildApp] yarn run v1.21.1
$ webpack --config webpack.prod.config.js
[webpack-cli] ModuleNotFoundError: Module not found: Error: Can't resolve 'ipysheet/style/index.js' in '/home/hafnium/miniconda3/share/jupyter/lab/staging/build'
    at /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/Compilation.js:1773:28
    at /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:811:13
    at eval (eval at create (/home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
    at /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:286:22
    at eval (eval at create (/home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
    at /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:442:22
    at /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:124:11
    at /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:673:25
    at /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:882:8
    at /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:1002:5
resolve 'ipysheet/style/index.js' in '/home/hafnium/miniconda3/share/jupyter/lab/staging/build'
  Parsed request is a module
  using description file: /home/hafnium/miniconda3/share/jupyter/lab/staging/build/package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      /home/hafnium/miniconda3/share/jupyter/lab/staging/build/node_modules doesn't exist or is not a directory
      looking for modules in /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules
        existing directory /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/ipysheet
          using description file: /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/ipysheet/package.json (relative path: .)
            using description file: /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/ipysheet/package.json (relative path: ./style/index.js)
              no extension
                Field 'browser' doesn't contain a valid alias configuration
                /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/ipysheet/style/index.js doesn't exist
              .js
                Field 'browser' doesn't contain a valid alias configuration
                /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/ipysheet/style/index.js.js doesn't exist
              .json
                Field 'browser' doesn't contain a valid alias configuration
                /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/ipysheet/style/index.js.json doesn't exist
              .wasm
                Field 'browser' doesn't contain a valid alias configuration
                /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/ipysheet/style/index.js.wasm doesn't exist
              as directory
                /home/hafnium/miniconda3/share/jupyter/lab/staging/node_modules/ipysheet/style/index.js doesn't exist
      /home/hafnium/miniconda3/share/jupyter/lab/node_modules doesn't exist or is not a directory
      /home/hafnium/miniconda3/share/jupyter/node_modules doesn't exist or is not a directory
      /home/hafnium/miniconda3/share/node_modules doesn't exist or is not a directory
      /home/hafnium/miniconda3/node_modules doesn't exist or is not a directory
      /home/hafnium/node_modules doesn't exist or is not a directory
      /home/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
error Command failed with exit code 2.
martinRenou commented 3 years ago

You don't need to run this command anymore.

Installing ipysheet with pip install ipysheet or conda install -c conda-forge ipysheet is enough with JupyterLab 3.

TermeHansen commented 3 years ago

why do I then see this:

image

TermeHansen commented 3 years ago
(base) hafnium@ff4327d62088:~$ conda list | grep -e jupyterlab -e ipysheet
ipysheet                  0.5.0              pyhd8ed1ab_0    conda-forge
jupyterlab                3.1.7              pyhd8ed1ab_0    conda-forge
jupyterlab-widget-ketcher 0.1.4                    pypi_0    pypi
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
jupyterlab_server         2.7.1              pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        1.0.0              pyhd8ed1ab_1    conda-forge
martinRenou commented 3 years ago

I would recommend starting again from a clean conda environment

etienne-monier commented 3 years ago

I've got exactly the same problem and I use poetry. Here is my pyproject.toml.

...
[tool.poetry.dependencies]
python = "^3.8.1"
jupyterlab = "^3.1.7"
voila = "^0.2.10"
ipywidgets = "^7.6.3"
voila-vuetify = "^0.5.2"
ipyvuetify = "^1.8.1"
pandas = "^1.3.2"
ipysheet = "^0.5.0"
...
martinRenou commented 3 years ago

Could you run jupyter labextension list?

etienne-monier commented 3 years ago

Humm. That's stange.

I tried in the above environment, that gave me

poetry run jupyter labextension list           
JupyterLab v3.1.9
~/.cache/pypoetry/virtualenvs/ui-gippy-9fSVnKVh-py3.8/share/jupyter/labextensions
        jupyter-vuetify v1.8.1 enabled OK
        jupyter-vue v1.5.0 enabled OK
        ipysheet v0.5.0 enabled OK (python, ipysheet)
        bqplot v0.5.31 enabled OK (python, bqplot)
        @jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)
        @voila-dashboards/jupyterlab-preview v2.0.2 enabled OK (python, voila)

Other labextensions (built into JupyterLab)
   app dir: ~/.cache/pypoetry/virtualenvs/ui-gippy-9fSVnKVh-py3.8/share/jupyter/lab

The minimal example gave me

import ipysheet
sheet = ipysheet.sheet()
sheet
> Error displaying widget: model not found

I tried to make a new minimal environment with the following toml

...
[tool.poetry.dependencies]
python = ">=3.8"
jupyterlab = "3.1.7"
ipysheet = "^0.5.0"
...

And the minimal example worked.

I've got a question concerning ipysheet. Is it possible to make the sheet non-editable?