ModuleNotFoundError: No module named 'global_state'

Question:

For the small project I’m working on, I have to use the package easygui with import easygui. I believe I installed it correctly, but now I’m getting the error:

ModuleNotFoundError: No module named ‘global_state’

From my understanding, it has something to do with easygui. I tried uninstalling and reinstalling easygui for a possible fix, but no luck.

I’m installing version 0.3.5 through Ubuntu.

The traceback of the error:

Traceback (most recent call last):
                             File "/home/jmarlin3/smallprojects/cartoon-project.py", line 2, in <module>
                              import easygui #allows us to pick any file from our system
                             File "/home/jmarlin3/.local/lib/python3.8/site-packages/easygui/__init__.py", line 34, in <module>
                                                                                from .boxes.button_box import buttonbox
                                                         File "/home/jmarlin3/.local/lib/python3.8/site-packages/easygui/boxes/button_box.py", line 18, in <module>
                                                                          import global_state
ModuleNotFoundError: No module named 'global_state'
Asked By: James Marlin

||

Answers:

Maybe the problem is with your tkinter; in your python version try to import tkinter:

Python 3.8.10 (default, Jul 14 2021, 03:51:04) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter

If something like ‘_tkinter’ not found you have to install tkinter (to have it working properly!) to use easygui.
If you are using python2:

sudo apt-get install python-tk

python3:

sudo apt-get install python3-tk

And install easygui:

pip install easy_gui
Answered By: Francisco Wendel

I have ran command,
sudo apt-get install python3-tk

Also checked in python version

Import easygui

Still getting an error,
No module named global state error.

Could anyone help to resolve this?

Answered By: Srinivas R
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.