Skip to content

export_html not running out of the box #6841

Closed
@MPenaR

Description

@MPenaR

Describe the bug, what's wrong, and what you expected.

After a fresh installation of pyvista I tried to run the example of exporting to html. It complained of not having trame_vtk installed. I installed it with pip. Then it complained about not having trame installed. I installed it with pip. It still complains. Here is the error message right now:

Traceback (most recent call last):
  File "/home/manuel/Documentos/Pruebas/Python/Pyvistaplots/.env/lib/python3.12/site-packages/pyvista/plotting/plotter.py", line 677, in export_vtksz
    from pyvista.trame import PyVistaLocalView
  File "/home/manuel/Documentos/Pruebas/Python/Pyvistaplots/.env/lib/python3.12/site-packages/pyvista/trame/__init__.py", line 9, in <module>
    from pyvista.trame.jupyter import elegantly_launch
  File "/home/manuel/Documentos/Pruebas/Python/Pyvistaplots/.env/lib/python3.12/site-packages/pyvista/trame/jupyter.py", line 12, in <module>
    from trame.widgets import vuetify as vuetify2_widgets
ImportError: cannot import name 'vuetify' from 'trame.widgets' (/home/manuel/Documentos/Pruebas/Python/Pyvistaplots/.env/lib/python3.12/site-packages/trame/widgets/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/manuel/Documentos/Pruebas/Python/Pyvistaplots/test_html.py", line 12, in <module>
    pl.export_html('pv.html')  
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/manuel/Documentos/Pruebas/Python/Pyvistaplots/.env/lib/python3.12/site-packages/pyvista/plotting/plotter.py", line 638, in export_html
    data = self.export_vtksz(filename=None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/manuel/Documentos/Pruebas/Python/Pyvistaplots/.env/lib/python3.12/site-packages/pyvista/plotting/plotter.py", line 681, in export_vtksz
    raise ImportError('Please install trame to export')
ImportError: Please install trame to export

My python version is 3.12.6, but I have also tested it in 3.11.2.

Steps to reproduce the bug.

virtualenv test_html_export
source ./test_html_export/bin/activate
pip install trame trame_vtk pyvista
import pyvista as pv
from pyvista import examples
mesh = examples.load_uniform()
pl = pv.Plotter(shape=(1, 2))
_ = pl.add_mesh(
    mesh, scalars='Spatial Point Data', show_edges=True
)
pl.subplot(0, 1)
_ = pl.add_mesh(
    mesh, scalars='Spatial Cell Data', show_edges=True
)
pl.export_html('pv.html')  

System Information

--------------------------------------------------------------------------------
  Date: Fri Nov 22 14:34:00 2024 CET

                OS : Linux (Debian GNU/Linux 12)
            CPU(s) : 6
           Machine : x86_64
      Architecture : 64bit
       Environment : Python
        GPU Vendor : nouveau
      GPU Renderer : NVE7
       GPU Version : 4.3 (Core Profile) Mesa 22.3.6
  MathText Support : True

  Python 3.11.2 (main, Sep 14 2024, 03:00:30) [GCC 12.2.0]

           pyvista : 0.44.1
               vtk : 9.3.1
             numpy : 2.1.3
        matplotlib : 3.9.2
            scooby : 0.10.0
             pooch : 1.8.2
            pillow : 11.0.0
             trame : 3.7.0
      trame_client : 3.5.0
      trame_server : 3.2.3
         trame_vtk : 2.8.12
--------------------------------------------------------------------------------

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUh-oh! Something isn't working as expected.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions