mayavi 4.8.3 installation bugs - part 3
In the previous post I was attempting to install mayavi 4.8.3 and ran into a bunch of issues. This process didn't good smoothly on Ubuntu 2404 and I had to spend multiple hours debugging.
I finally got the package installed and thought things would be good so I called it a day. I then was able to run the simple python file with no issues.
However it still isn't completely working... :/
In the "testing your installation" section of the documentation it suggests that you should be able to run the mayavi2 command.
$ uv run mayavi2 -h
Usage:
mayavi2 [options] ... [arg1] [arg2] ...
Where arg1, arg2 ... are optional file names that correspond to saved
Mayavi2 visualizations (file.mv2) or Mayavi2 scripts (file.py) or any
data files supported by Mayavi. Valid options are one or more of the
following:
-d datafile.ext
--data datafile.ext
datafile.ext can be any of the supported data file formats. This
includes VTK file formats (*.vtk, *.xml, *.vt[i,p,r,s,u],
*.pvt[i,p,r,s,u]), VRML2 (*.wrl), 3D Studio (*.3ds), PLOT3D
(*.xyz), STL, BYU, RAW, PLY, PDB, SLC, FACET, OBJ, AVSUCD
(*.inp), GAMBIT (*.neu), Exodus (*.exii), PNG, JPEG, BMP,
PNM, DCM, DEM, MHA, MHD, MINC, XIMG, TIFF, and various others that
are supported. datafile.ext can also be a source object not
associated with a file, for example ParametricSurface or PointLoad
will load the corresponding data sources into Mayavi.
Running the help command works which seems like we are getting somewhere. So lets try to run the app:
$ uv run mayavi2
Traceback (most recent call last):
File "/home/janis/experimental-code/.venv/bin/mayavi2", line 4, in <module>
from mayavi.scripts.mayavi2 import main
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/mayavi/scripts/mayavi2.py", line 462, in <module>
from mayavi.plugins.app import Mayavi, setup_logger
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/mayavi/plugins/app.py", line 19, in <module>
from .mayavi_workbench_application import MayaviWorkbenchApplication
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/mayavi/plugins/mayavi_workbench_application.py", line 13, in <module>
from envisage.ui.workbench.api import WorkbenchApplication
ModuleNotFoundError: No module named 'envisage'
Oh no, more untracked dependencies... :/
This time envisage: https://pypi.org/project/envisage/
$ uv add envisage
Resolved 48 packages in 698ms
Installed 2 packages in 37ms
+ envisage==7.0.4
+ setuptools==80.9.0
Attempting to run again:
$ uv run mayavi2
/home/janis/experimental-code/.venv/lib/python3.12/site-packages/envisage/egg_plugin_manager.py:19: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
ERROR|2025-07-10 16:50:08,910|error creating view control [envisage.plugins.python_shell_view]
Traceback (most recent call last):
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/ui/qt/workbench/workbench_window_layout.py", line 106, in add_view
self._qt4_add_view(view, position, relative_to, size)
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/ui/qt/workbench/workbench_window_layout.py", line 469, in _qt4_add_view
dw = self._qt4_create_view_dock_widget(view, size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/ui/qt/workbench/workbench_window_layout.py", line 541, in _qt4_create_view_dock_widget
view.control = view.create_control(dw.widget())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/envisage/plugins/python_shell/view/python_shell_view.py", line 122, in create_control
self.bind(name, value)
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/envisage/plugins/python_shell/view/python_shell_view.py", line 175, in bind
self.shell.bind(name, value)
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/i_python_shell.py", line 124, in bind
self.interpreter().locals[name] = value
^^^^^^^^^^^^^^^^^^
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/ui/qt/python_shell.py", line 88, in interpreter
return self.control.interpreter
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'interpreter'
ERROR|2025-07-10 16:50:08,945|Exception occurred in traits notification handler for object: <envisage.ui.workbench.workbench_window.WorkbenchWindow object at 0x7e1cb0d5d8b0>, trait: active_perspective, old value: None, new value: Perspective(Mayavi)
Traceback (most recent call last):
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/ui/qt/workbench/workbench_window_layout.py", line 106, in add_view
self._qt4_add_view(view, position, relative_to, size)
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/ui/qt/workbench/workbench_window_layout.py", line 469, in _qt4_add_view
dw = self._qt4_create_view_dock_widget(view, size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/ui/qt/workbench/workbench_window_layout.py", line 541, in _qt4_create_view_dock_widget
view.control = view.create_control(dw.widget())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/envisage/plugins/python_shell/view/python_shell_view.py", line 122, in create_control
self.bind(name, value)
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/envisage/plugins/python_shell/view/python_shell_view.py", line 175, in bind
self.shell.bind(name, value)
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/i_python_shell.py", line 124, in bind
self.interpreter().locals[name] = value
^^^^^^^^^^^^^^^^^^
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/ui/qt/python_shell.py", line 88, in interpreter
return self.control.interpreter
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'interpreter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/traits/trait_notifiers.py", line 343, in __call__
self.handler(*args)
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/workbench/workbench_window.py", line 808, in _active_perspective_changed
self._show_perspective(old, new)
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/workbench/workbench_window.py", line 756, in _show_perspective
new.create(self)
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/workbench/perspective.py", line 97, in create
self._add_contents(window, self.contents)
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/workbench/perspective.py", line 134, in _add_contents
self._add_perspective_item(window, item)
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/workbench/perspective.py", line 155, in _add_perspective_item
window.add_view(
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/workbench/workbench_window.py", line 297, in add_view
self.layout.add_view(view, position, relative_to, size)
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/pyface/ui/qt/workbench/workbench_window_layout.py", line 115, in add_view
view.destroy_control()
File "/home/janis/experimental-code/.venv/lib/python3.12/site-packages/envisage/plugins/python_shell/view/python_shell_view.py", line 146, in destroy_control
self.window.application.unregister_service(self._service_id)
^^^^^^^^^^^^^^^^
AttributeError: 'PythonShellView' object has no attribute '_service_id'
At least it appears to run now. Not sure what is going on with these AttributeError: 'NoneType' object has no attribute 'interpreter' error messages, that's clearly another bug.
A very quick search found this open issue: https://github.com/enthought/mayavi/issues/1008
This post is part 3 of the "mayavi-installation" series: