2

This is my first question on Stack Oveflow, so forgive me if I do something wrong. I've been using Python for a few months. I'm trying to make a simple GUI. I came across EasyGUI.

When i try to import the module, i get an error:

    Traceback (most recent call last):
  File "C:/Users/matthewr/PycharmProjects/testing start/Tsting.py", line 1, in <module>
    import easygui
  File "C:\Users\matthewr\AppData\Local\Programs\Python\Python35-32\lib\site-packages\easygui\__init__.py", line 50, in <module>
    from .boxes.choice_box import choicebox
  File "C:\Users\matthewr\AppData\Local\Programs\Python\Python35-32\lib\site-packages\easygui\boxes\choice_box.py", line 76
    except Exception, e:
                    ^
SyntaxError: invalid syntax

I erased everything in my code except import easygui but the error still comes up.

I uninstalled and reinstalled using pip, but no luck.

any help would be appreciated.

Christian Dean
  • 22,138
  • 7
  • 54
  • 87
MattR
  • 4,887
  • 9
  • 40
  • 67
  • 1
    Could you post the error that shows when you only say _import easygui_? – Christian Dean Aug 09 '16 at 16:43
  • First sight seems to me like some mess with python versions. Not really sure. Which version of python are you using? – lrnzcig Aug 09 '16 at 16:43
  • Are you still getting the Exception error even when your just importing _easygui_? – Christian Dean Aug 09 '16 at 16:47
  • Your probably using a version of _easygui_ that was meant to work in an older version of python. – Christian Dean Aug 09 '16 at 16:49
  • Mr.Python - that is the error i get when i only say import easygui. I am using the latest version of Python. I am using the latest version of easygui – MattR Aug 09 '16 at 18:36
  • Well in python 3+, I belive you have to say `except Exception as e`. – Christian Dean Aug 09 '16 at 19:13
  • where do i place `except Exception as e` ? When i ran that code i got the following: `File "C:\Users\matthewr\AppData\Local\Programs\Python\Python35-32\lib\site-packages\easygui\boxes\choice_box.py", line 76 except Exception, e: ^ SyntaxError: invalid syntax` – MattR Aug 09 '16 at 19:19

3 Answers3

8

Try easygui 0.96.0

I've been using easygui for some time but I had exactly the same problem today on a new machine with a fresh install of 3.5.2 with easygui 0.98.0. However, easygui 0.96.0 works for me.

  1. reverted to Py 3.5.1, same problem.
  2. easygui 0.97 same issue on both Py 3.5.1, and 3.5.2
  3. Py 3.5.2 with easygui 0.96.0 - works fine!

pip uninstall easygui

pip install easygui==0.96.0

Len J
  • 96
  • 1
1

Just to help any others still stuck on this problem since the above did not work for me:

Do the following to install!

pip uninstall easygui

you may need to do it twice, until it says "Successfully uninstalled easygui-0.98.0"

Then run:

sudo apt-get install python3-easygui

IDK why this works but I am assuming it is because there is some bug in the version pip uses!

Note This will only work on ubuntu machines!

0

I actually ran into this issue once again. I had to use the version of Anaconda that was provided to me and was not allowed to use pip due to permissions.

A quick solution was to go into choice_box.py and remove , e on line 76/83 of the file. So it should simply read except Exception:. Since removing this little line, the library runs as exceptected on version 0.98.0

MattR
  • 4,887
  • 9
  • 40
  • 67