Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PySImpleGui error code AttributeError: module 'PySimpleGUI' has no attribute 'Popup'

Just trying to make a simple window appear and I get this error code:

AttributeError: module 'PySimpleGUI' has no attribute 'Popup'

import PySimpleGUI as sg


sg.Popup('this is my first popup')
like image 877
Rick Avatar asked Aug 01 '26 21:08

Rick


1 Answers

It sounds like a bad install, or you've got another PySimpleGUI.py file in your path. If you're using PyCharm, control-click the word PySimpleGUI and see where it takes you.

Can you supply info about your runtime setup? Windows/Linux? Versions (Python, PySimpleGUI), etc.

You can get the PySimpleGUI version by entering

pip show PySimpleGUI

It might be worth uninstalling and reinstalling

pip uninstall PySimpleGUI

pip install --no-cache-dir --upgrade PySimpleGUI

[EDIT]

It's often helpful to know exactly what was imported. This can be achieved by adding a print after the import.

import PySimpleGUI as sg
print(sg)

This will tell you the location of your PySimpleGUI.py file. Very handy if you're getting one from somewhere in your path, but you don't know exactly where.

like image 95
Mike from PSG Avatar answered Aug 04 '26 11:08

Mike from PSG



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!