widgetti / ipyvolume

3d plotting for Python in the Jupyter notebook based on IPython widgets using WebGL
MIT License
1.93k stars 234 forks source link

Notebook with ipyvolume not working : install problem ? #415

Open patquem opened 2 years ago

patquem commented 2 years ago

Hello,

One year ago, I succeed in using ipyvolume with a python-3.7.7 kernel. Today, working on a new virtual env (with the same python kernel), impossible to make my notebook running. From a new ('empty') virtual env. , I have tested and limited the 'pip' install process to the following packages :

a jupyter nbextensions list shows that ipyvolume and jupyter-threejs are both enabled.

For testing, I have executed the example given in the the first page of the ipyvolume website (the one with ipv.quickvolshow()), and nothing happened.

Note that when opening a new .ipynb, the following messages appears in my console :

[I 11:08:43.203 NotebookApp] Creating new notebook in /libs/common/notebooks [W 11:08:44.385 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20220905110826 (::1) 6.030000ms referer=http://localhost:8888/notebooks/libs/common/notebooks/Untitled.ipynb?kernel_name=python3 [I 11:08:44.388 NotebookApp] Kernel started: 101fa28b-9754-4e8f-925c-b49df97331cd, name: python3 [IPKernelApp] ERROR | No such comm target registered: jupyter.widget.control [IPKernelApp] WARNING | No such comm: 46087822-cd9d-4712-b126-b83734d4178e

But according to notes on forum this error and warning are harmless (https://github.com/jupyter-widgets/ipywidgets/issues/3454 or https://discourse.jupyter.org/t/ipkernelapp-error-and-warning/13820/7). (I was not faced to these messages in my previous virtual env)

Then, when running the example, the following error messages appear :

[W 11:09:15.941 NotebookApp] 404 GET /static/jupyter-threejs.js?v=20220905110826 (::1) 0.000000ms referer=http://localhost:8888/notebooks/libs/common/notebooks/Untitled.ipynb?kernel_name=python3 [W 11:09:15.990 NotebookApp] 404 GET /static/three.js?v=20220905110826 (::1) 0.000000ms referer=http://localhost:8888/notebooks/libs/common/notebooks/Untitled.ipynb?kernel_name=python3

Any idea of what's wrong ? Do you reproduce these problems when installing ipyvolume ? Any suggestion to do a correct ipyvolume install ? (I pass a lot of time to try to fix this problem : downgrading packages / adding jupyter complement ones .. without any success).

Thank you for your help, Patrick

patquem commented 2 years ago

Note that when downgrading pythreejs from 2.4.1 to 2.3.0, the notebook returns the following outputs:

image

ixakalabadie commented 1 year ago

I get almost the same messages. When I open the notebook:

[W 16:52:19.689 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20221010165117 (127.0.0.1) 1.090000ms referer=http://localhost:8889/notebooks/Visualization/ipyvolume/ipyvolume_test.ipynb

except that I do not get the "comm target" error message (the first times i installed everything I did but not anymore).

When I run the code (e.g. ipv.quickvolshow(V, level=[0.25, 0.75], opacity=0.03, level_width=0.1, data_min=0, data_max=1)) the kernel gets stuck and I have to disconnect the notebook server. The error message I get:

[W 16:53:38.313 NotebookApp] 404 GET /static/jupyter-threejs.js?v=20221010165117 (127.0.0.1) 3.020000ms referer=http://localhost:8889/notebooks/Visualization/ipyvolume/ipyvolume_test.ipynb [W 16:53:38.682 NotebookApp] 404 GET /static/three.js?v=20221010165117 (127.0.0.1) 1.840000ms referer=http://localhost:8889/notebooks/Visualization/ipyvolume/ipyvolume_test.ipynb

If I just run ipv.figure() nothing shows but the kernel does not get stuck.

I installed all the packages with conda with the latest versions

jcfaracco commented 1 year ago

Probably, I'm getting a similar result when I run a simple example using Lab:

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'FigureModel' from module 'ipyvolume'
loadClass@http://127.0.0.1:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.bcbea9feb6e7c4da7530.js?v=bcbea9feb6e7c4da7530:1:74977
loadModelClass@http://127.0.0.1:8888/static/lab/4416.e3828afa11aab94744e3.js?v=e3828afa11aab94744e3:1:11350
_make_model@http://127.0.0.1:8888/static/lab/4416.e3828afa11aab94744e3.js?v=e3828afa11aab94744e3:1:9238

My versions:

All minimal dependencies are met, including the extensions and the installation doc.

jcfaracco commented 1 year ago

@ixakalabadie I tested using a notebook only and I got the same behavior. 😞

mlamarre commented 1 year ago

I had the same behavior. Contrary to @patquem using pythreejs==2.3.0 worked for me.

Maybe because of the package manager. Here's how I downgraded pythreejs:

mamba install pythreejs==2.3.0 -c conda-forge

Mamba then decided on its own to use ipywidgets==7.7.2, jupyterlab_widgets==1.1.1 and widgetnbextension==3.6.1.

My notebooks were working fine July 24th 2022, pythreejs and ipywidgets both got bumped since then, so it could be any of the two.

ixakalabadie commented 1 year ago

I downgraded to pythreejs=2.3.0 and it changed to ipywidgets=7.6.5, jupyterlab_widgets=3.0.3 and widgetnmextension=3.5.2. Still didn't work. I forced ipywidgets=7.7.2 and it changed the other packages to the versions @mlamarre mentioned but still no luck. This is the error I get now:

[W 12:52:26.827 NotebookApp] 404 GET /static/components/jquery-ui/themes/smoothness/jquery-ui.min.css (127.0.0.1) 2.330000ms referer=http://localhost:8888/notebooks/Visualization/ipyvolume/ipyvolume_test.ipynb [W 12:52:27.520 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20221019125136 (127.0.0.1) 1.770000ms referer=http://localhost:8888/notebooks/Visualization/ipyvolume/ipyvolume_test.ipynb [I 12:52:27.524 NotebookApp] Kernel started: cc0ff42d-e744-4ede-baaa-3cbb31fab738, name: python3 [W 12:52:54.832 NotebookApp] 404 GET /static/jupyter-threejs.js?v=20221019125136 (127.0.0.1) 5.540000ms referer=http://localhost:8888/notebooks/Visualization/ipyvolume/ipyvolume_test.ipynb [W 12:52:55.367 NotebookApp] 404 GET /static/three.js?v=20221019125136 (127.0.0.1) 2.550000ms referer=http://localhost:8888/notebooks/Visualization/ipyvolume/ipyvolume_test.ipynb <

Could you @mlamarre send the list of all installed packages in your environment for comparison? Thanks

mlamarre commented 1 year ago

Here is my full environment, environment.yml

I still see the following logs, but everything works fine:

[E 15:53:20.345 NotebookApp] Could not open static file '' [W 15:53:20.383 NotebookApp] 404 GET /static/components/jquery-ui/themes/smoothness/jquery-ui.min.css (::1) 7.000000ms referer= [redacted] [W 15:53:26.053 NotebookApp] 404 GET /static/components/jquery-ui/themes/smoothness/jquery-ui.min.css (::1) 2.000000ms referer=http://localhost:8888/notebooks/[redacted] [I 15:53:26.706 NotebookApp] Kernel started: [redacted] name: python3 [IPKernelApp] ERROR | No such comm target registered: jupyter.widget.control [IPKernelApp] WARNING | No such comm: [redacted]

ixakalabadie commented 1 year ago

Thank you. I created it but still does not work. You are using windows right? I am using ubuntu 22.04. Some errors I get are the same but I have some other ones as well:

[E 11:56:37.449 NotebookApp] Could not open static file '' [W 11:56:37.627 NotebookApp] 404 GET /static/components/jquery-ui/themes/smoothness/jquery-ui.min.css (127.0.0.1) 7.720000ms referer=http://localhost:8888/tree?token=1489dd20117a86a0f4060f4551d0298cc3e0d5f2f7284812 [W 11:56:47.249 NotebookApp] 404 GET /static/components/jquery-ui/themes/smoothness/jquery-ui.min.css (127.0.0.1) 2.800000ms referer=http://localhost:8888/notebooks/Visualization/ipyvolume/ipyvolume_test.ipynb [W 11:56:47.785 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20221026115635 (127.0.0.1) 1.760000ms referer=http://localhost:8888/notebooks/Visualization/ipyvolume/ipyvolume_test.ipynb [I 11:56:48.042 NotebookApp] Kernel started: 016c4781-2e20-4e2c-9191-9ef238857796, name: python3 [W 11:56:58.572 NotebookApp] 404 GET /static/jupyter-threejs.js?v=20221026115635 (127.0.0.1) 4.510000ms referer=http://localhost:8888/notebooks/Visualization/ipyvolume/ipyvolume_test.ipynb [W 11:56:59.060 NotebookApp] 404 GET /static/three.js?v=20221026115635 (127.0.0.1) 1.850000ms referer=http://localhost:8888/notebooks/Visualization/ipyvolume/ipyvolume_test.ipynb

kevinwwillis commented 1 year ago

I had the same behavior. Contrary to @patquem using pythreejs==2.3.0 worked for me.

This also worked for me. I reinstalled Jupyter, ipywidgets, and all else related to ipyvolume. After this, ipyvolume still did not work and I continued to get the two 404s that @patquem had. Downgrading pythreejs to 2.3.0 finally got ipyvolume working for the first time on my remote machine. Thanks!