Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter backends problems (trame, ipyvtk, k3d) #1206

Open
YongcaiHuang opened this issue Nov 30, 2024 · 2 comments
Open

Jupyter backends problems (trame, ipyvtk, k3d) #1206

YongcaiHuang opened this issue Nov 30, 2024 · 2 comments

Comments

@YongcaiHuang
Copy link

k3d

"""Create a Volume from a numpy array"""
import numpy as np
from vedo import Volume, show, settings
settings.default_backend = "k3d"

data_matrix = np.zeros([70, 80, 90], dtype=np.uint8)
data_matrix[ 0:30,  0:30,  0:30] = 1
data_matrix[30:50, 30:60, 30:70] = 2
data_matrix[50:70, 60:80, 70:90] = 3

vol = Volume(data_matrix)
vol.cmap(['white','b','g','r']).mode(1)
vol.add_scalarbar()

show(vol, __doc__, axes=1)
Error displaying widget: model not found

ipyvtk

"""Create a Volume from a numpy array"""
import numpy as np
from vedo import Volume, show, settings
settings.default_backend = "ipyvtk"

data_matrix = np.zeros([70, 80, 90], dtype=np.uint8)
data_matrix[ 0:30,  0:30,  0:30] = 1
data_matrix[30:50, 30:60, 30:70] = 2
data_matrix[50:70, 60:80, 70:90] = 3

vol = Volume(data_matrix)
vol.cmap(['white','b','g','r']).mode(1)
vol.add_scalarbar()

show(vol, __doc__, axes=1)
file: plotter.py
-> 663 x, y = screensize
ValueError: too many values to unpack (expected 2)

trame

"""Create a Volume from a numpy array"""
import numpy as np
import vedo
from vedo import Volume, show, settings
settings.default_backend = "trame"

data_matrix = np.zeros([70, 80, 90], dtype=np.uint8)
data_matrix[ 0:30,  0:30,  0:30] = 1
data_matrix[30:50, 30:60, 30:70] = 2
data_matrix[50:70, 60:80, 70:90] = 3

vol = Volume(data_matrix)
vol.cmap(['white','b','g','r']).mode(1)
vol.add_scalarbar()

show(vol, __doc__, axes=1)
file: vue2.py
-> 16 raise TypeError(
     17         f"Server using client_type='{client_type}' while we expect 'vue2'"
TypeError: Server using client_type='vue3' while we expect 'vue2'

I tried to manually change the client_type into vue2, but error remains

...
from trame import app
server = app.get_server()
server.client_type = "vue2"
settings.default_backend = "trame"
...

Env

Package                           Version
--------------------------------- --------------
absl-py                           2.1.0
aiohappyeyeballs                  2.4.3
aiohttp                           3.10.10
aiosignal                         1.3.1
aiosqlite                         0.20.0
alabaster                         1.0.0
altair                            5.4.1
altair_pandas                     0.1.0.dev0
annotated-types                   0.7.0
anyio                             3.7.1
appnope                           0.1.4
appscript                         1.3.0
argon2-cffi                       23.1.0
argon2-cffi-bindings              21.2.0
arrow                             1.3.0
astroid                           3.3.5
asttokens                         2.4.1
astunparse                        1.6.3
async-lru                         2.0.4
attrs                             24.2.0
autopep8                          2.0.4
babel                             2.16.0
beautifulsoup4                    4.12.3
black                             24.10.0
bleach                            6.1.0
bokeh                             3.6.0
build                             1.2.2.post1
CacheControl                      0.14.0
cattrs                            24.1.2
certifi                           2024.8.30
cffi                              1.17.1
charset-normalizer                3.4.0
cleo                              2.1.0
click                             8.1.7
cloudpickle                       3.1.0
cmocean                           4.0.3
colorcet                          3.1.0
colour-science                    0.4.6
comm                              0.2.2
contourpy                         1.3.0
crashtest                         0.4.1
curio                             1.6
cycler                            0.12.1
dask                              2024.10.0
dataclasses-json                  0.6.7
debugpy                           1.8.7
decorator                         5.1.1
deepmerge                         2.0
defusedxml                        0.7.1
dill                              0.3.9
distlib                           0.3.9
distributed                       2024.10.0
docrepr                           0.2.0
docstring-to-markdown             0.15
docutils                          0.21.2
dulwich                           0.21.7
et-xmlfile                        1.1.0
exceptiongroup                    1.2.2
executing                         2.1.0
faiss-cpu                         1.8.0
fastjsonschema                    2.20.0
filelock                          3.16.1
flake8                            7.1.1
flatbuffers                       24.3.25
fonttools                         4.54.1
fqdn                              1.5.1
frozenlist                        1.5.0
fsspec                            2024.10.0
grpcio                            1.67.0
h11                               0.14.0
httpcore                          1.0.6
httpx                             0.27.2
httpx-sse                         0.4.0
huggingface-hub                   0.26.2
idna                              3.10
imageio                           2.36.0
imagesize                         1.4.1
importlib_metadata                8.5.0
iniconfig                         2.0.0
installer                         0.7.0
intersphinx_registry              0.2411.25
ipycanvas                         0.13.3
ipyevents                         2.0.2
ipyflow-core                      0.0.204
ipykernel                         6.29.5
ipympl                            0.9.4
ipyparallel                       9.0.0
ipython                           8.30.0
ipython-genutils                  0.2.0
ipyvtklink                        0.2.3
ipywidgets                        7.8.5
isoduration                       20.11.0
isort                             5.13.2
jaraco.classes                    3.4.0
jax                               0.4.35
jaxlib                            0.4.35
jedi                              0.19.1
Jinja2                            3.1.4
joblib                            1.4.2
json5                             0.9.25
jsonpatch                         1.33
jsonpath-ng                       1.7.0
jsonpointer                       3.0.0
jsonschema                        4.23.0
jsonschema-specifications         2024.10.1
jupyter_ai                        2.28.0
jupyter_ai_magics                 2.28.0
jupyter_bokeh                     4.0.5
jupyter_client                    8.6.3
jupyter-console                   6.6.3
jupyter_core                      5.7.2
jupyter-events                    0.10.0
jupyter-lsp                       2.2.5
jupyter-resource-usage            1.1.0
jupyter_server                    2.14.2
jupyter_server_proxy              4.4.0
jupyter_server_terminals          0.5.3
jupyterlab                        4.2.5
jupyterlab_cell_flash             0.4.0
jupyterlab_code_formatter         3.0.2
jupyterlab_execute_time           3.2.0
jupyterlab-lsp                    5.1.0
jupyterlab_pygments               0.3.0
jupyterlab-rainbow-brackets       0.1.0
jupyterlab_server                 2.27.3
jupyterlab-spellchecker           0.8.4
jupyterlab-spreadsheet            0.4.2
jupyterlab-spreadsheet-editor     0.7.2
jupyterlab-unfold                 0.3.2
jupyterlab_widgets                1.1.11
jupyterlabcodetoc                 4.0.1
jupytext                          1.16.4
k3d                               2.16.1
keyring                           24.3.1
kiwisolver                        1.4.7
langchain                         0.2.17
langchain-community               0.2.18
langchain-core                    0.2.43
langchain-mistralai               0.1.13
langchain-text-splitters          0.2.4
langsmith                         0.1.141
lazy_loader                       0.4
lckr_jupyterlab_variableinspector 3.2.4
linkify-it-py                     2.0.3
locket                            1.0.0
lsprotocol                        2023.0.1
lxml                              5.3.0
Markdown                          3.7
markdown-it-py                    3.0.0
MarkupSafe                        3.0.2
marshmallow                       3.23.1
matplotlib                        3.9.2
matplotlib-inline                 0.1.7
mccabe                            0.7.0
mdit-py-plugins                   0.4.2
mdurl                             0.1.2
mediapipe                         0.10.15
meshio                            5.3.5
mistune                           3.0.2
ml_dtypes                         0.5.0
more-itertools                    10.5.0
mpmath                            1.3.0
msgpack                           1.1.0
multidict                         6.1.0
mypy-extensions                   1.0.0
narwhals                          1.10.0
nbclassic                         1.1.0
nbclient                          0.10.0
nbconvert                         7.16.4
nbformat                          5.10.4
nest-asyncio                      1.6.0
networkx                          3.4.2
notebook                          7.2.2
notebook_shim                     0.2.4
numpy                             1.26.4
opencv-contrib-python             4.10.0.84
openpyxl                          3.1.5
opt_einsum                        3.4.0
orjson                            3.10.11
outcome                           1.3.0.post0
overrides                         7.7.0
packaging                         24.1
pandas                            2.2.3
pandas-flavor                     0.6.0
pandocfilters                     1.5.1
panel                             1.5.3
param                             2.1.1
parso                             0.8.4
partd                             1.4.2
pathspec                          0.12.1
patsy                             0.5.6
pexpect                           4.9.0
pickleshare                       0.7.5
pillow                            11.0.0
pingouin                          0.5.5
pip                               24.3.1
pkginfo                           1.11.2
platformdirs                      4.3.6
pluggy                            1.5.0
ply                               3.11
poetry                            1.8.4
poetry-core                       1.9.1
poetry-plugin-export              1.8.0
pooch                             1.8.2
prometheus_client                 0.21.0
prompt_toolkit                    3.0.48
propcache                         0.2.0
protobuf                          4.25.5
psutil                            5.9.8
ptyprocess                        0.7.0
pure_eval                         0.2.3
pyccolo                           0.0.67
pycodestyle                       2.12.1
pycparser                         2.22
pydantic                          2.9.2
pydantic_core                     2.23.4
pydocstyle                        6.3.0
pyflakes                          3.2.0
pygls                             1.3.1
Pygments                          2.18.0
pyinstrument                      5.0.0
pylint                            3.3.1
pyparsing                         3.2.0
pyproject_hooks                   1.2.0
PySide6                           6.8.0.2
PySide6_Addons                    6.8.0.2
PySide6_Essentials                6.8.0.2
pytest                            8.3.3
pytest-asyncio                    0.21.2
python-dateutil                   2.9.0.post0
python-json-logger                2.0.7
python-lsp-jsonrpc                1.1.2
python-lsp-server                 1.12.0
pytoolconfig                      1.3.1
pytz                              2024.2
pyvista                           0.44.2
pyviz_comms                       3.0.3
PyYAML                            6.0.2
pyzmq                             26.2.0
qtconsole                         5.6.1
QtPy                              2.4.2
RapidFuzz                         3.10.1
referencing                       0.35.1
requests                          2.32.3
requests-toolbelt                 1.0.0
rfc3339-validator                 0.1.4
rfc3986-validator                 0.1.1
rich                              13.9.4
rope                              1.13.0
rpds-py                           0.20.0
SciencePlots                      2.1.1
scikit-image                      0.24.0
scikit-learn                      1.5.2
scikit-posthocs                   0.10.0
scipy                             1.14.1
scooby                            0.10.0
seaborn                           0.13.2
selectivesearch                   0.4
Send2Trash                        1.8.3
setuptools                        75.2.0
shellingham                       1.5.4
shiboken6                         6.8.0.2
simpervisor                       1.0.0
six                               1.16.0
sniffio                           1.3.1
snowballstemmer                   2.2.0
sortedcontainers                  2.4.0
sounddevice                       0.5.1
soupsieve                         2.6
Sphinx                            8.1.3
sphinx-rtd-theme                  3.0.2
sphinxcontrib-applehelp           2.0.0
sphinxcontrib-devhelp             2.0.0
sphinxcontrib-htmlhelp            2.1.0
sphinxcontrib-jquery              4.1
sphinxcontrib-jsmath              1.0.1
sphinxcontrib-qthelp              2.0.0
sphinxcontrib-serializinghtml     2.0.0
SQLAlchemy                        2.0.36
stack-data                        0.6.3
statsmodels                       0.14.4
sympy                             1.13.1
tabulate                          0.9.0
tblib                             3.0.0
tenacity                          8.5.0
tensorboard                       2.18.0
tensorboard-data-server           0.7.2
terminado                         0.18.1
testpath                          0.6.0
threadpoolctl                     3.5.0
tifffile                          2024.9.20
tinycss2                          1.4.0
tokenizers                        0.20.3
tomli                             2.0.2
tomlkit                           0.13.2
toolz                             1.0.0
torch                             2.5.0
torchaudio                        2.5.0
torchsummary                      1.5.1
torchvision                       0.20.0
tornado                           6.4.1
tqdm                              4.66.5
traitlets                         5.14.3
traittypes                        0.2.1
trame                             3.7.0
trame-client                      3.5.0
trame-server                      3.2.3
trame-vtk                         2.8.12
trame-vuetify                     2.7.2
trio                              0.27.0
trove-classifiers                 2024.10.21.16
types-python-dateutil             2.9.0.20241003
typing_extensions                 4.12.2
typing-inspect                    0.9.0
tzdata                            2024.2
uc-micro-py                       1.0.3
ujson                             5.10.0
uri-template                      1.3.0
urllib3                           2.2.3
vedo                              2024.5.2
virtualenv                        20.27.0
voila                             0.5.8
vtk                               9.3.1
wcwidth                           0.2.13
webcolors                         24.8.0
webencodings                      0.5.1
websocket-client                  1.8.0
websockets                        13.1
Werkzeug                          3.0.5
whatthepatch                      1.0.6
wheel                             0.44.0
widgetsnbextension                3.6.10
wslink                            2.2.1
xarray                            2024.10.0
xattr                             1.1.0
xlwings                           0.33.3
xyzservices                       2024.9.0
yapf                              0.40.2
yarl                              1.17.1
zict                              3.0.0
zipp                              3.20.2
@marcomusy
Copy link
Owner

Well this is strange... it works in my ubuntu :

Screenshot from 2024-12-02 18-22-10

@YongcaiHuang
Copy link
Author

this is previous error. I also tried different version of jupyter (>4), but the issue remains
k3d

then, I tried it in a new env it works. it's strange

aiohappyeyeballs          2.4.4
aiohttp                   3.11.9
aiosignal                 1.3.1
anyio                     4.6.2.post1
appnope                   0.1.4
argon2-cffi               23.1.0
argon2-cffi-bindings      21.2.0
arrow                     1.3.0
asttokens                 3.0.0
async-lru                 2.0.4
attrs                     24.2.0
babel                     2.16.0
beautifulsoup4            4.12.3
bleach                    6.2.0
certifi                   2024.8.30
cffi                      1.17.1
charset-normalizer        3.4.0
comm                      0.2.2
contourpy                 1.3.1
cycler                    0.12.1
debugpy                   1.8.9
decorator                 5.1.1
defusedxml                0.7.1
executing                 2.1.0
fastjsonschema            2.21.1
fonttools                 4.55.1
fqdn                      1.5.1
frozenlist                1.5.0
h11                       0.14.0
httpcore                  1.0.7
httpx                     0.28.0
idna                      3.10
ipykernel                 6.29.5
ipython                   8.30.0
ipywidgets                8.1.5
isoduration               20.11.0
jedi                      0.19.2
Jinja2                    3.1.4
json5                     0.10.0
jsonpointer               3.0.0
jsonschema                4.23.0
jsonschema-specifications 2024.10.1
jupyter_client            8.6.3
jupyter_core              5.7.2
jupyter-events            0.10.0
jupyter-lsp               2.2.5
jupyter_server            2.14.2
jupyter_server_terminals  0.5.3
jupyterlab                4.3.1
jupyterlab_pygments       0.3.0
jupyterlab_server         2.27.3
jupyterlab_widgets        3.0.13
k3d                       2.16.1
kiwisolver                1.4.7
MarkupSafe                3.0.2
matplotlib                3.9.3
matplotlib-inline         0.1.7
mistune                   3.0.2
more-itertools            10.5.0
msgpack                   1.1.0
multidict                 6.1.0
nbclient                  0.10.1
nbconvert                 7.16.4
nbformat                  5.10.4
nest-asyncio              1.6.0
notebook_shim             0.2.4
numpy                     2.1.3
overrides                 7.7.0
packaging                 24.2
pandocfilters             1.5.1
parso                     0.8.4
pexpect                   4.9.0
pillow                    11.0.0
pip                       24.2
platformdirs              4.3.6
prometheus_client         0.21.0
prompt_toolkit            3.0.48
propcache                 0.2.1
psutil                    6.1.0
ptyprocess                0.7.0
pure_eval                 0.2.3
pycparser                 2.22
Pygments                  2.18.0
pyparsing                 3.2.0
python-dateutil           2.9.0.post0
python-json-logger        2.0.7
PyYAML                    6.0.2
pyzmq                     26.2.0
referencing               0.35.1
requests                  2.32.3
rfc3339-validator         0.1.4
rfc3986-validator         0.1.1
rpds-py                   0.22.0
Send2Trash                1.8.3
setuptools                74.1.2
six                       1.16.0
sniffio                   1.3.1
soupsieve                 2.6
stack-data                0.6.3
terminado                 0.18.1
tinycss2                  1.4.0
tornado                   6.4.2
traitlets                 5.14.3
traittypes                0.2.1
trame                     3.7.0
trame-client              3.5.0
trame-server              3.2.3
types-python-dateutil     2.9.0.20241003
typing_extensions         4.12.2
uri-template              1.3.0
urllib3                   2.2.3
vedo                      2024.5.2
vtk                       9.4.0
wcwidth                   0.2.13
webcolors                 24.11.1
webencodings              0.5.1
websocket-client          1.8.0
widgetsnbextension        4.0.13
wslink                    2.2.1
yarl                      1.18.3

as for the trame, I downgrade trame into 2.5.2, and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants