chriskiehl / GooeyExamples

Example programs to Demonstrate Gooey's functionality
MIT License
305 stars 73 forks source link

`ImportError: cannot import name 'Events' from 'gooey'` when running `python3.8 examples/lifecycle_hooks.py` #36

Open abrichr opened 2 years ago

abrichr commented 2 years ago

Describe the bug running python3.8 examples/lifecycle_hooks.py generates an exception: `ImportError: cannot import name 'Events' from 'gooey'.

To Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/chriskiehl/GooeyExamples.git
  2. cd GooeyExamples
  3. pip install -r requirements.txt
  4. python3.8 examples/lifecycle_hooks.py
  5. Observe exception:
Traceback (most recent call last):
  File "examples/lifecycle_hooks.py", line 4, in <module>
    from gooey import Events, Gooey, GooeyParser
ImportError: cannot import name 'Events' from 'gooey' (/.../python3.8/site-packages/gooey/__init__.py)

Expected behavior Example runs without error

Desktop (please complete the following information):

abrichr commented 2 years ago

Attempting to upgrade gooey:

pip install gooey==1.2.0a0  
Collecting gooey==1.2.0a0
  Using cached Gooey-1.2.0a0-py2.py3-none-any.whl (766 kB)
Requirement already satisfied: Pillow>=4.3.0 in ./env/lib/python3.8/site-packages (from gooey==1.2.0a0) (9.2.0)
ERROR: Could not find a version that satisfies the requirement dataclasses>=0.8 (from gooey) (from versions: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6)
ERROR: No matching distribution found for dataclasses>=0.8
abrichr commented 2 years ago

Python 3.6 fails while installing wxpython:

python3.6 -m pip install -r requirements.txt
...
Command "/.../GooeyExamples/env/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/35/pqjnmmwx24d2mtf4frt5dhcc0000gn/T/pip-install-0knweuch/wxpython/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/35/pqjnmmwx24d2mtf4frt5dhcc0000gn/T/pip-record-w5xjelww/install-record.txt --single-version-externally-managed --compile --install-headers /.../GooeyExamples/env/include/site/python3.6/wxpython" failed with error code 1 in /private/var/folders/35/pqjnmmwx24d2mtf4frt5dhcc0000gn/T/pip-install-0knweuch/wxpython/

Python 3.10 fails at runtime:

python3.10 examples/lifecycle_hooks.py
...
Traceback (most recent call last):
  File "/.../GooeyExamples/examples/lifecycle_hooks.py", line 4, in <module>
    from gooey import Events, Gooey, GooeyParser
ImportError: cannot import name 'Events' from 'gooey' (/.../GooeyExamples/env/lib/python3.10/site-packages/gooey/__init__.py)

Attempting to upgrade to gooey 1.2:

pip install gooey==1.2.0a0
...
ERROR: Ignored the following versions that require a different python version: 0.7 Requires-Python >=3.6, <3.7; 0.8 Requires-Python >=3.6, <3.7
ERROR: Could not find a version that satisfies the requirement dataclasses>=0.8 (from gooey) (from versions: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6)
ERROR: No matching distribution found for dataclasses>=0.8

How to run examples/lifecycle_hooks.py?