enthought / envisage

Envisage is a Python-based framework for building applications whose functionalities can be extended by adding "plug-ins".
http://docs.enthought.com/envisage/
Other
81 stars 26 forks source link

Example demo/plugins/tasks/run_attractor.py broken #570

Closed yves-surrel closed 1 year ago

yves-surrel commented 1 year ago

pyface 8.0.0 envisage 6.0.1

Example throws:

...
from pyface.action.i_tool_bar_manager import IToolBarManager
  File "/Users/yves/opt/miniconda3/lib/python3.8/site-packages/pyface/action/i_tool_bar_manager.py", line 14, in <module>
    from pyface.ui_traits import Orientation
ImportError: cannot import name 'Orientation' from 'pyface.ui_traits' (/Users/yves/opt/miniconda3/lib/python3.8/site-packages/pyface/ui_traits.py)

After fixing that one, it breaks again:

File "/Users/yves/opt/miniconda3/lib/python3.8/site-packages/pyface/ui/qt/tasks/advanced_editor_area_pane.py", line 14, in <module>
    from pyface.qt import QtCore, QtGui, is_pyside, is_qt6
ImportError: cannot import name 'is_pyside' from 'pyface.qt' (/Users/yves/opt/miniconda3/lib/python3.8/site-packages/pyface/qt/__init__.py)

After fixing that one, another crash:

 File "/Users/yves/opt/miniconda3/lib/python3.8/site-packages/envisage/examples/demo/plugins/tasks/attractors/plot_2d_pane.py", line 2, in <module>
    from chaco.chaco_plot_editor import ChacoPlotItem
ModuleNotFoundError: No module named 'chaco.chaco_plot_editor'

After fixing that one, another crash:

Traceback (most recent call last):
  File "run_attractor.py", line 26, in <module>
    main(sys.argv)
  File "run_attractor.py", line 16, in main
    app.run()
  File "/Users/yves/opt/miniconda3/lib/python3.8/site-packages/envisage/ui/tasks/tasks_application.py", line 175, in run
    self._create_windows()
  File "/Users/yves/opt/miniconda3/lib/python3.8/site-packages/envisage/ui/tasks/tasks_application.py", line 354, in _create_windows
    window = self.create_window(window_layout, restore=True)
  File "/Users/yves/opt/miniconda3/lib/python3.8/site-packages/envisage/ui/tasks/tasks_application.py", line 240, in create_window
    window = self.window_factory(application=self, **traits)
  File "/Users/yves/opt/miniconda3/lib/python3.8/site-packages/traits/has_traits.py", line 3384, in _init_trait_observers
    self.observe(
  File "/Users/yves/opt/miniconda3/lib/python3.8/site-packages/traits/has_traits.py", line 2325, in observe
    observe_api.observe(
  File "/Users/yves/opt/miniconda3/lib/python3.8/site-packages/traits/observation/observe.py", line 53, in observe
    add_or_remove_notifiers(
  File "/Users/yves/opt/miniconda3/lib/python3.8/site-packages/traits/observation/_observe.py", line 54, in add_or_remove_notifiers
    callable_()
  File "/Users/yves/opt/miniconda3/lib/python3.8/site-packages/traits/observation/_observe.py", line 94, in __call__
    step()
  File "/Users/yves/opt/miniconda3/lib/python3.8/site-packages/traits/observation/_observe.py", line 163, in _add_or_remove_notifiers
    for observable in self.graph.node.iter_observables(self.object):
  File "/Users/yves/opt/miniconda3/lib/python3.8/site-packages/traits/observation/_named_trait_observer.py", line 87, in iter_observables
    raise ValueError(
ValueError: Trait named 'menu_bar_manager' not found on <envisage.ui.tasks.task_window.TaskWindow object at 0x7fd7cfcd5a90>.
corranwebster commented 1 year ago

Quick check: do you perhaps have multiple pyface installs in your PYTHONPATH somehow? This can happen if you have a site-packages-installed package alongside a pip-installed in-place package (eg. you did pip install -e .)

The first error shouldn't be happening if you have Pyface 8 installed (or indeed later versions of Pyface 7.x)

yves-surrel commented 1 year ago

@corranwebster : yes, you are right, something was twisted in my install. Now, the example runs smoothly. Thx.