chaco icon indicating copy to clipboard operation
chaco copied to clipboard

Chaco & WX fail

Open fred4ets opened this issue 5 years ago • 9 comments

Hello,

Chaco fails to run with ETS_TOOLKIT set to "wx"

For instance, any example in Chaco demo directory fail :

python3 scatter.py

Traceback (most recent call last):
  File "scatter.py", line 22, in <module>
    from enable.api import Component, ComponentEditor
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev52-py3.7-linux-x86_64.egg/enable/api.py", line 21, in <module>
    from .markers import MarkerTrait, marker_trait, MarkerNameDict, marker_names, \
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev52-py3.7-linux-x86_64.egg/enable/markers.py", line 18, in <module>
    from .compiled_path import CompiledPath
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev52-py3.7-linux-x86_64.egg/enable/compiled_path.py", line 17, in <module>
    from .toolkit import toolkit_object
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev52-py3.7-linux-x86_64.egg/enable/toolkit.py", line 47, in <module>
    _init_toolkit()
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev52-py3.7-linux-x86_64.egg/enable/toolkit.py", line 35, in _init_toolkit
    __import__(backend)
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev52-py3.7-linux-x86_64.egg/enable/wx/image.py", line 18, in <module>
    from .base_window import BaseWindow
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev52-py3.7-linux-x86_64.egg/enable/wx/base_window.py", line 22, in <module>
    from .constants import (
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev52-py3.7-linux-x86_64.egg/enable/wx/constants.py", line 127, in <module>
    wx.WXK_NEXT,
AttributeError: module 'wx' has no attribute 'WXK_NEXT'

Debian 10 x86_64 (stable), Python 3.7.3, wx 4.0.4 gtk3 (phoenix) wxWidgets 3.0.4 with ETS source code updated

Regards

fred4ets avatar Oct 22 '20 08:10 fred4ets

This looks like an Enable issue - I think the problem is that the appropriate fixes for wxPython 4 haven't been merged yet: see https://github.com/enthought/enable/pull/403

corranwebster avatar Oct 22 '20 09:10 corranwebster

And https://github.com/enthought/enable/pull/401

corranwebster avatar Oct 22 '20 09:10 corranwebster

Closing via https://github.com/enthought/enable/pull/403

kitchoi avatar Dec 08 '20 09:12 kitchoi

Hi,

OK. I just updated sources.

Now, when I run scatter.py, I get the following:

/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev90-py3.7-linux-x86_64.egg/kiva/agg/plat_support.py:199: wxPyDeprecationWarning: Call to deprecated item EmptyImage. Use :class:`Image` instead.
  image = wx.EmptyImage(*sz)
/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev90-py3.7-linux-x86_64.egg/kiva/agg/plat_support.py:201: wxPyDeprecationWarning: Call to deprecated item BitmapFromImage. Use :class:`wx.Bitmap` instead
  bmp = wx.BitmapFromImage(image, depth=-1)
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev90-py3.7-linux-x86_64.egg/enable/abstract_window.py", line 480, in _paint
    self._window_paint(event)
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev90-py3.7-linux-x86_64.egg/enable/wx/image.py", line 57, in _window_paint
    pixel_map.draw_to_wxwindow(control, 0, 0)
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev90-py3.7-linux-x86_64.egg/kiva/agg/plat_support.py", line 201, in draw_to_wxwindow
    bmp = wx.BitmapFromImage(image, depth=-1)
  File "/usr/lib/python3/dist-packages/wx/core.py", line 83, in deprecated_func
    return item(*args, **kw)
TypeError: BitmapFromImage() got an unexpected keyword argument 'depth'
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev90-py3.7-linux-x86_64.egg/enable/abstract_window.py", line 480, in _paint
    self._window_paint(event)
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev90-py3.7-linux-x86_64.egg/enable/wx/image.py", line 57, in _window_paint
    pixel_map.draw_to_wxwindow(control, 0, 0)
  File "/usr/local/lib/python3.7/dist-packages/enable-4.8.1.dev90-py3.7-linux-x86_64.egg/kiva/agg/plat_support.py", line 201, in draw_to_wxwindow
    bmp = wx.BitmapFromImage(image, depth=-1)
  File "/usr/lib/python3/dist-packages/wx/core.py", line 83, in deprecated_func
    return item(*args, **kw)
TypeError: BitmapFromImage() got an unexpected keyword argument 'depth'

fred4ets avatar Dec 08 '20 10:12 fred4ets

@fred4ets Thank you very much for trying the source. Sorry that https://github.com/enthought/enable/pull/403 did not fix the problem. May I ask which scatter.py file you try and what packages did you have when you tested this? These information will expedite the process of tracking down the issues and actually making sure the issue is fixed. Thanks again.

kitchoi avatar Dec 08 '20 11:12 kitchoi

I run scatter.py from Chaco's demo/basic.

python 3.7.3 + wx 4.0.4 on debian stable x86_64

Traits packages installed & used: chaco-4.8.1-dev 87 enable-4.8.1.dev90 traitsui-7.2.0.dev416-py3.7.egg traits-6.2.0.dev1651

Please ask if you want more info.

fred4ets avatar Dec 08 '20 12:12 fred4ets

Thank you very much @fred4ets. This will be looked into.

kitchoi avatar Dec 09 '20 11:12 kitchoi

Hello,

Any news about this issue ?

Thanks.

fred4ets avatar Apr 23 '21 06:04 fred4ets

@fred4ets sorry for not getting back to you sooner. I am unable to reproduce the error you report above https://github.com/enthought/chaco/issues/531#issuecomment-740546173 with the latest enable and chaco. I tried reproducing this on windows + python 3.6 but it is possible that this is a platform-specific issue (linux only). I opened https://github.com/enthought/enable/issues/798 to track the issue in enable

rahulporuri avatar Apr 26 '21 07:04 rahulporuri