问题
I installed PyDev in Eclipse to run Python programs, but I’m facing trouble importing simplegui
. It is showing me this error:
import simplegui
ImportError
: No module namedsimplegui
My installed PyDev version is 2.7.1.
回答1:
Did you learn Python using CodeSkulptor? simplegui is a custom module for CodeSkulptor, meaning that it is only available in CodeSkulptor.
More information here.
回答2:
You can use SimpleGUICS2Pygame. Just change import simplegui by import SimpleGUICS2Pygame.simpleguics2pygame as simplegui in your CodeSkulptor program and run it in standard Python
回答3:
I am using a Mac, when I installed simplegui
off of the Python website, I had to import it as:
import simpleguitk
I also downloaded it through terminal with the command:
sudo pip install SimpleGUITk
回答4:
Simple, download simplegui.zip form http://florian-berger.de/en/software/simplegui.
unzip simplegui-x.x.x.zip
cd simplegui-x.x.x
python setup.py install
Replace x.x.x
with version number. You might want to run the last step with sudo rights.
来源:https://stackoverflow.com/questions/13815722/trouble-importing-simplegui