jupyter-widgets / pythreejs

A Jupyter - Three.js bridge
https://pythreejs.readthedocs.io
Other
936 stars 185 forks source link

Request to bundle Javascript with the Python package #299

Closed moorepants closed 4 years ago

moorepants commented 4 years ago

I have yet to get this running on my personal computer and I feel like it must be because the javascript lab extensions aren't being installed properly. Plotly packages all of their JS code with the Python packages so it isn't necessary to use a JS package manager in addition to pip or conda. Is it possible to do that with pythreejs? It would really be nice if conda install pythreejs just worked.

vidartf commented 4 years ago

The build JS is definitely bundled with the python wheel. Not sure about the conda package, as I haven't been super involved with that one.

vidartf commented 4 years ago

TBH, looking at the conda packages, it looks like it should be supported. I actually just created a new conda env and installed pythreejs, and it got the extension installed both for classic and lab. It is hard for me to diagnose why it isn't working for you with the little info given. Here's what I did for my test env:

conda create -n testenv python=3.7 jupyterlab pythreejs -y
conda activate testenv

# Check that extensions are installed
jupyter nbextension list
jupyter labextension list

# If you want to use it with lab, you also need the ipywidgets labextension (as any widget extension will)
jupyter labextension install @jupyter-widgets/jupyterlab-manager
moorepants commented 4 years ago

I discovered other issues. Jupyterlab 1.0+ was not being installed due to version conflicts in my root environment and then also in a testenv. I finally got that worked out. I know have a working conda env with pythreejs + jupyterlab + the other packages I need.

As for:

jupyter labextension install @jupyter-widgets/jupyterlab-manager

Shouldn't this be run when we install ipywidgets?

vidartf commented 4 years ago

Shouldn't this be run when we install ipywidgets?

There are split opinions on this. It should probably be in an FAQ or existing issue somewhere in the ipywidgets repo.

moorepants commented 4 years ago

There are split opinions on this.

Just to record mine: I think that the user should never have to run these custom jupyterlab package manager commands. I think it is much easier for an end user to simply use 1 package manager to get things installed, e.g. conda install ipywidgets pythreejs or pip install ipywidgets pythreejs.

vidartf commented 4 years ago

Just to record mine: I think that the user should never have to run these custom jupyterlab package manager commands.

Sure, but this would be better posted on the ipywidgets repo :)

vidartf commented 4 years ago

Also, any use of extensions with jupyterlab involves a package manager (either in the install step, or in the build step). There's no way of getting around that currently, although some people are trying to make progress in that regards on the jupyterlab repo (further discussion of that should be taken there).