K3D-tools / K3D-jupyter

K3D lets you create 3D plots backed by WebGL with high-level API (surfaces, isosurfaces, voxels, mesh, cloud points, vtk objects, volume renderer, colormaps, etc). The primary aim of K3D-jupyter is to be easy for use as stand alone package like matplotlib, but also to allow interoperation with existing libraries as VTK.
MIT License
953 stars 121 forks source link

Issue with TransferFunctionModel Instantiation #455

Closed SukiYume closed 4 months ago

SukiYume commented 5 months ago

Description

I was trying to run the transfer_function.ipynb example from the k3d-jupyter package. When running the code, I encountered the following error:

Model class 'TransferFunctionModel' from module 'k3d' is loaded but can not be instantiated
TypeError: r._deserialize_state is not a function
    at f._make_model

It seems there might be an issue with the dependency on ipywidgets. Based on the information from this ipywidgets issue, it appears that the dependency needs to be updated.

Could you please let me know if there are plans to resolve this issue? Thank you!

artur-trzesiok commented 4 months ago

Hi @SukiYume I'm not able to reproduce that issue. Please tell me what ipywidgets and jupyter notebook are you using

SukiYume commented 4 months ago

Hi @artur-trzesiok

Thank you for your response. I am able to consistently reproduce the issue by following these steps:

Create a new Python 3.8 environment using conda, and only install the necessary packages using conda: notebook, numpy, and k3d.

conda create -n testenv python=3.8
conda install -c conda-forge numpy notebook k3d

Here are the specific package versions in this environment:

k3d=2.16.1 notebook=7.2.1 ipywidgets=8.1.3 jupyterlab=4.2.3

Despite these steps, I still encounter this error. I have attached a screenshot of the error for your reference.

test

artur-trzesiok commented 4 months ago

@SukiYume I have it! It is related to notebook 7.x - trying to fix it

SukiYume commented 4 months ago

Thank you for resolving the issue promptly!