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

ぐ巨炮叔叔 提交于 2020-06-28 06:01:26

问题


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')

回答1:


You import 'PySimpleGUI' from the place where no 'Popup'.

Probably you named your file PySimpleGUI.py (and in your file no 'Popup'). In this case rename the file...

Or it might be other file with the name PySimpleGUI.py (where no 'Popup') in the directory where your file is.

Python should open the module (where 'Popup' is present).




回答2:


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



来源:https://stackoverflow.com/questions/54240983/pysimplegui-error-code-attributeerror-module-pysimplegui-has-no-attribute-po

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!