lux icon indicating copy to clipboard operation
lux copied to clipboard

[BUG] Binder Jupyter Notebooks Error

Open eavidan opened this issue 3 years ago • 6 comments

Running the binder tutorial I receive the following error

/srv/conda/envs/notebook/lib/python3.7/site-packages/IPython/core/formatters.py:918: UserWarning:
Unexpected error in rendering Lux widget and recommendations. Falling back to Pandas display.
Please report the following issue on Github: https://github.com/lux-org/lux/issues 

/srv/conda/envs/notebook/lib/python3.7/site-packages/lux/core/frame.py:628: UserWarning:Traceback (most recent call last):
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/lux/core/frame.py", line 590, in _ipython_display_
    self.maintain_recs()
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/lux/core/frame.py", line 447, in maintain_recs
    self._widget = rec_df.render_widget()
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/lux/core/frame.py", line 675, in render_widget
    import luxwidget
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/luxwidget/__init__.py", line 4, in <module>
    from .widget import LuxWidget
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/luxwidget/widget.py", line 5, in <module>
    from ._frontend import module_name, module_version
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/luxwidget/_frontend.py", line 3, in <module>
    from ._version import __version__
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/luxwidget/_version.py", line 18, in <module>
    __version__ = _fetchVersion()
  File "/srv/conda/envs/notebook/lib/python3.7/site-packages/luxwidget/_version.py", line 16, in _fetchVersion
    raise FileNotFoundError(f"Could not find package.json under dir {HERE!s}")
FileNotFoundError: Could not find package.json under dir /srv/conda/envs/notebook/lib/python3.7/site-packages/luxwidget

eavidan avatar May 03 '21 09:05 eavidan

Hi @eavidan, Thank you for reporting this issue! I made a temporary fix to resolve this issue. For now, you could try out Lux with Binder for JupyterLab here!

dorisjlee avatar May 03 '21 15:05 dorisjlee

Hey @dorisjlee did you find out what was causing this? I'm running into a similar issue where it can't find package.json when I have made changes to luxwidget and then am trying to install in a different environment over pip.

I feel like it might have something to do with how LuxWidget is build or installed but I haven't been able to nail it down.

Was your temp fix just to manually add the package.json to wherever luxwidget is installed?

willeppy avatar May 12 '21 20:05 willeppy

Hey @willeppy, My temporary fix was simply to add an additional folder with the package.json (luxwidget/labextension/package.json), and it seems to work for JupyterLab. Are you using JupyterLab or Jupyter Notebook when building locally?

dorisjlee avatar May 12 '21 20:05 dorisjlee

I've been testing locally with jupyter lab and it works fine. The issue is coming up when I try to install both my version of lux and luxwidget in a fresh environment and I'm getting the same FileNotFoundError: Could not find package.json error.

I'm running this to install in fresh environment.

pip install git+https://github.com/willeppy/lux.git
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install luxwidget

and the install runs but I get the error when it tries to load luxwidget in the notebook

willeppy avatar May 12 '21 20:05 willeppy

Hey @willeppy, I just tested this in a fresh virtualenv:

pip install lux-api
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install luxwidget

and it is working in the jupyter lab. If you want to build the frontend locally based on your Git fork, I would suggest doing:

git clone [email protected]:lux-org/lux-widget.git
cd lux-widget
npm install
sh install.sh # for Jupyter Notebook
or 
sh install_lab.sh # for Jupyter Lab

Let me know if that resolves the problem that you're seeing.

dorisjlee avatar May 16 '21 00:05 dorisjlee

Jupyter notebook Binder link not working. We still need to debug this. Screen Shot 2021-07-09 at 11 06 22 AM Screen Shot 2021-07-09 at 11 07 24 AM

dorisjlee avatar Jul 09 '21 18:07 dorisjlee