enthought / enable

Enable: low-level drawing and interaction
Other
91 stars 45 forks source link

ImportError: cannot import name 'ConstraintsContainer' from 'enable.api' when running enable/enable/examples/demo/enable/constraints_demo.py #1046

Closed homosapien-lcy closed 1 year ago

homosapien-lcy commented 1 year ago

Problem Description: When running enable/enable/examples/demo/enable/constraints_demo.py, a ImportError: cannot import name 'ConstraintsContainer' from 'enable.api' is raised.

How to replicate:

python3.11 enable/enable/examples/demo/enable/constraints_demo.py

Stacktrace: (py311) (base) cyliu@aus552cyliu enable % python3.11 enable/examples/demo/enable/constraints_demo.py kiwisolver import failed. Please check it is installed. Traceback (most recent call last): File "/Users/cyliu/Documents/3.11_test/enable/enable/examples/demo/enable/constraints_demo.py", line 16, in from enable.api import Component, ComponentEditor, ConstraintsContainer ImportError: cannot import name 'ConstraintsContainer' from 'enable.api' (/Users/cyliu/Documents/3.11_test/enable/enable/api.py)

Link: https://github.com/enthought/enable/blob/main/enable/examples/demo/enable/constraints_demo.py

Environment: MacOS, python3.11

Packages: Package Version Editable project location


apptools 5.2.0 attrdict 2.0.1 attrdict3 2.0.2 blosc2 2.0.0 celiagg 2.1.3 certifi 2022.12.7 chaco 5.1.0 charset-normalizer 3.1.0 configobj 5.0.8 cPython 0.0.6 Cython 0.29.34 dnspython 2.3.0 enable 5.4.0.dev31 /Users/cyliu/Documents/3.11_test/enable fonttools 4.39.2 h5py 3.8.0 idna 3.4 joblib 1.2.0 msgpack 1.0.5 numexpr 2.8.4 numpy 1.24.2 packaging 23.1 pandas 1.5.3 Pillow 9.4.0 pip 23.1 py-cpuinfo 9.0.0 PyAudio 0.2.13 pyface 8.0.0 /Users/cyliu/Documents/3.11_test/pyface pygarrayimage 1.0 pyglet 2.0.5 /Users/cyliu/Documents/3.11_test/pyglet Pygments 2.14.0 pymongo 4.3.3 pyparsing 3.0.9 PySide6 6.4.3 PySide6-Addons 6.4.3 PySide6-Essentials 6.4.3 python-dateutil 2.8.2 pythonw 3.0.3 pytz 2023.2 reportlab 3.6.12 requests 2.28.2 scikit-learn 1.2.2 scipy 1.10.1 setuptools 65.6.3 shiboken6 6.4.3 six 1.16.0 tables 3.8.0 threadpoolctl 3.1.0 traits 6.4.1 traitsui 8.0.0.dev0 /Users/cyliu/Documents/3.11_test/traitsui urllib3 1.26.15 wxPython 4.2.0

homosapien-lcy commented 1 year ago

Strangely, this demo works after kiwisolver is installed... this solution is not really described by the error raised... Currently, the error message mentioned that the "kiwisolver" is not installed, while also points to unable to import ConstraintsContainer from enable.api. Which is ok but a little confusing, should we change this or not?

mdickinson commented 1 year ago

Isn't this the exact same issue as #1018?

homosapien-lcy commented 1 year ago

Isn't this the exact same issue as #1018?

Yeah, correct. Almost forgot I was solving this issue. The new error message we introduced turned out to be useful then. : ) I will go ahead and close this